@@ 0,0 1,14 @@
+-- Your SQL goes here
+
+CREATE TABLE gamedata (
+ 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,
+ turn SMALLINT NOT NULL,
+ host_hand json,
+ host_deck json,
+ guest_hand json,
+ guest_deck json
+);
+
+SELECT diesel_manage_updated_at('gamedata');
@@ 1,6 1,30 @@
// @generated automatically by Diesel CLI.
diesel::table! {
+ actions (id) {
+ id -> Uuid,
+ created_at -> Timestamp,
+ updated_at -> Timestamp,
+ invoker -> Uuid,
+ data -> Json,
+ timestamp -> Timestamp,
+ }
+}
+
+diesel::table! {
+ gamedata (id) {
+ id -> Uuid,
+ created_at -> Timestamp,
+ updated_at -> Timestamp,
+ turn -> Int2,
+ host_hand -> Nullable<Json>,
+ host_deck -> Nullable<Json>,
+ guest_hand -> Nullable<Json>,
+ guest_deck -> Nullable<Json>,
+ }
+}
+
+diesel::table! {
users (id) {
id -> Uuid,
created_at -> Timestamp,
@@ 10,3 34,11 @@ diesel::table! {
password -> Varchar,
}
}
+
+diesel::joinable!(actions -> users (invoker));
+
+diesel::allow_tables_to_appear_in_same_query!(
+ actions,
+ gamedata,
+ users,
+);