use diesel to manage SQL

This commit is contained in:
Fabien Freling 2025-06-20 13:03:55 +02:00
parent 888ada6a07
commit 01566042b3
4 changed files with 18 additions and 0 deletions

0
migrations/.keep Normal file
View file

View file

@ -0,0 +1,2 @@
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS `tasks`;

View 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
View file

@ -0,0 +1,9 @@
// @generated automatically by Diesel CLI.
diesel::table! {
tasks (id) {
id -> Integer,
title -> Text,
description -> Text,
}
}