interior_refs -> interior_ref_lists, finish insert

This commit is contained in:
2020-07-23 00:13:31 -04:00
parent 0275143559
commit 29eadabc8a
10 changed files with 2271 additions and 2468 deletions

View File

@@ -20,7 +20,7 @@ pub fn migration() -> String {
m.create_table("shops", |t| {
t.add_column("id", types::primary().indexed(true));
t.add_column("name", types::varchar(255));
t.add_column("owner_id", types::foreign("owners", "id"));
t.add_column("owner_id", types::foreign("owners", "id").indexed(true));
t.add_column("description", types::text().nullable(true));
t.add_column("is_not_sell_buy", types::boolean().default(true));
t.add_column("sell_buy_list_id", types::integer().default(0));
@@ -36,7 +36,7 @@ pub fn migration() -> String {
m.create_table("merchandise", |t| {
t.add_column("id", types::primary().indexed(true));
t.add_column("shop_id", types::foreign("shops", "id"));
t.add_column("shop_id", types::foreign("shops", "id").indexed(true));
t.add_column("mod_name", types::varchar(255));
t.add_column("local_form_id", types::integer());
t.add_column("quantity", types::integer());
@@ -50,7 +50,7 @@ pub fn migration() -> String {
m.create_table("transactions", |t| {
t.add_column("id", types::primary().indexed(true));
t.add_column("shop_id", types::foreign("shops", "id"));
t.add_column("shop_id", types::foreign("shops", "id").indexed(true));
t.add_column("merchandise_id", types::foreign("merchandise", "id"));
t.add_column("customer_name", types::varchar(255));
t.add_column("is_customer_npc", types::boolean());
@@ -60,12 +60,10 @@ pub fn migration() -> String {
t.add_column("created_at", types::custom("timestamp(3)"));
});
// TODO: rename to interior_reflist or similar?
// TODO: index shop_id col
m.create_table("interior_refs", |t| {
m.create_table("interior_ref_lists", |t| {
t.add_column("id", types::primary().indexed(true));
t.add_column("shop_id", types::foreign("shops", "id"));
t.add_column("references", types::custom("jsonb"));
t.add_column("shop_id", types::foreign("shops", "id").indexed(true));
t.add_column("ref_list", types::custom("jsonb"));
t.add_column("created_at", types::custom("timestamp(3)"));
t.add_column("updated_at", types::custom("timestamp(3)"));
});