use diesel to manage SQL
This commit is contained in:
parent
888ada6a07
commit
01566042b3
4 changed files with 18 additions and 0 deletions
0
migrations/.keep
Normal file
0
migrations/.keep
Normal file
2
migrations/2025-06-20-111801_create_tasks/down.sql
Normal file
2
migrations/2025-06-20-111801_create_tasks/down.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE IF EXISTS `tasks`;
|
7
migrations/2025-06-20-111801_create_tasks/up.sql
Normal file
7
migrations/2025-06-20-111801_create_tasks/up.sql
Normal file
|
@ -0,0 +1,7 @@
|
|||
-- Your SQL goes here
|
||||
CREATE TABLE `tasks`(
|
||||
`id` INT4 NOT NULL PRIMARY KEY,
|
||||
`title` VARCHAR NOT NULL,
|
||||
`description` TEXT NOT NULL
|
||||
);
|
||||
|
9
src/schema.rs
Normal file
9
src/schema.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// @generated automatically by Diesel CLI.
|
||||
|
||||
diesel::table! {
|
||||
tasks (id) {
|
||||
id -> Integer,
|
||||
title -> Text,
|
||||
description -> Text,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue