From 0924c954b800cdf27f9a773f1d07748e555afaf8 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Thu, 8 Feb 2024 18:37:55 -0500 Subject: [PATCH] Create artists table --- .../2024-02-06-145714_create_artists_table/down.sql | 1 + .../2024-02-06-145714_create_artists_table/up.sql | 4 ++++ src/schema.rs | 12 ++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 migrations/2024-02-06-145714_create_artists_table/down.sql create mode 100644 migrations/2024-02-06-145714_create_artists_table/up.sql diff --git a/migrations/2024-02-06-145714_create_artists_table/down.sql b/migrations/2024-02-06-145714_create_artists_table/down.sql new file mode 100644 index 0000000..943c085 --- /dev/null +++ b/migrations/2024-02-06-145714_create_artists_table/down.sql @@ -0,0 +1 @@ +DROP TABLE artists; diff --git a/migrations/2024-02-06-145714_create_artists_table/up.sql b/migrations/2024-02-06-145714_create_artists_table/up.sql new file mode 100644 index 0000000..73802e6 --- /dev/null +++ b/migrations/2024-02-06-145714_create_artists_table/up.sql @@ -0,0 +1,4 @@ +CREATE TABLE artists ( + id SERIAL PRIMARY KEY UNIQUE NOT NULL, + name VARCHAR NOT NULL +); diff --git a/src/schema.rs b/src/schema.rs index 2e9b462..58b691a 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -1,5 +1,12 @@ // @generated automatically by Diesel CLI. +diesel::table! { + artists (id) { + id -> Int4, + name -> Varchar, + } +} + diesel::table! { users (id) { id -> Int4, @@ -9,3 +16,8 @@ diesel::table! { created_at -> Timestamp, } } + +diesel::allow_tables_to_appear_in_same_query!( + artists, + users, +);