A api/migrations/2023-02-17-075706_create_users/down.sql => api/migrations/2023-02-17-075706_create_users/down.sql +3 -0
@@ 0,0 1,3 @@
+-- This file should undo anything in `up.sql`
+
+DROP TABLE users;
A api/migrations/2023-02-17-075706_create_users/up.sql => api/migrations/2023-02-17-075706_create_users/up.sql +12 -0
@@ 0,0 1,12 @@
+-- Your SQL goes here
+
+CREATE TABLE users (
+ id uuid PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(),
+ created_at TIMESTAMP NOT NULL DEFAULT current_timestamp,
+ updated_at TIMESTAMP NOT NULL DEFAULT current_timestamp,
+ username VARCHAR NOT NULL,
+ email VARCHAR NOT NULL,
+ password VARCHAR NOT NULL
+);
+
+SELECT diesel_manage_updated_at('users');
M api/src/schema.rs => api/src/schema.rs +10 -0
@@ 1,2 1,12 @@
// @generated automatically by Diesel CLI.
+diesel::table! {
+ users (id) {
+ id -> Uuid,
+ created_at -> Timestamp,
+ updated_at -> Timestamp,
+ username -> Varchar,
+ email -> Varchar,
+ password -> Varchar,
+ }
+}