DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

a17eeda927a09d673254d76f6b94c1f6af1a0b3f — Jonni Liljamo 1 year, 8 months ago 254cb76
feat(api): migration create_users
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,
    }
}