Skip to content

Commit

Permalink
[Upd] Added diesel orm dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Minigrim0 committed Jun 7, 2023
1 parent 27bca95 commit 7a38372
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build/
# Added by cargo

/target
.env
138 changes: 138 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
diesel = { version = "2.1.0", features = ["sqlite"] }
dotenvy = "0.15"
8 changes: 8 additions & 0 deletions diesel.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# For documentation on how to configure this file,
# see https://diesel.rs/guides/configuring-diesel-cli

[print_schema]
file = "src/schema.rs"

[migrations_directory]
dir = "migrations"
Empty file added migrations/.keep
Empty file.
2 changes: 2 additions & 0 deletions migrations/2023-06-07-134015_create_tasks/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- This file should undo anything in `up.sql`
DROP TABLE tasks;
8 changes: 8 additions & 0 deletions migrations/2023-06-07-134015_create_tasks/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Your SQL goes here
CREATE TABLE tasks (
id INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
status boolean DEFAULT false NOT NULL -- false = not done, true = done
);

0 comments on commit 7a38372

Please sign in to comment.