Browse Source

should probably split this since theres already live data

pbs
jake 4 years ago
parent
commit
4954dcb789
  1. 24
      src/entity/gateway/postgres/migrations/V0001__initial.sql
  2. 23
      src/entity/gateway/postgres/migrations/V0002__equips.sql
  3. 2
      src/entity/item/mod.rs

24
src/entity/gateway/postgres/migrations/V0001__initial.sql

@ -122,27 +122,3 @@ create table mag_modifier (
modifier jsonb not null, modifier jsonb not null,
created_at timestamptz default current_timestamp not null created_at timestamptz default current_timestamp not null
); );
create table equipped (
pchar integer references player_character (id) unique not null,
weapon integer references item (id),
armor integer references item (id),
shield integer references item (id),
unit0 integer references item (id),
unit1 integer references item (id),
unit2 integer references item (id),
unit3 integer references item (id),
mag integer references item (id)
);
create table inventory (
pchar integer references player_character (id) unique not null,
items jsonb not null
);
create table bank (
pchar integer references player_character (id) not null,
items jsonb not null,
name varchar(128) not null,
unique (pchar, name)
);

23
src/entity/gateway/postgres/migrations/V0002__equips.sql

@ -0,0 +1,23 @@
create table equipped (
pchar integer references player_character (id) unique not null,
weapon integer references item (id),
armor integer references item (id),
shield integer references item (id),
unit0 integer references item (id),
unit1 integer references item (id),
unit2 integer references item (id),
unit3 integer references item (id),
mag integer references item (id)
);
create table inventory (
pchar integer references player_character (id) unique not null,
items jsonb not null
);
create table bank (
pchar integer references player_character (id) not null,
items jsonb not null,
name varchar(128) not null,
unique (pchar, name)
);

2
src/entity/item/mod.rs

@ -217,7 +217,7 @@ impl InventoryItemEntity {
} }
} }
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
#[derive(Clone, Debug, Default)]
pub struct EquippedEntity { pub struct EquippedEntity {
pub weapon: Option<ItemEntityId>, pub weapon: Option<ItemEntityId>,
pub armor: Option<ItemEntityId>, pub armor: Option<ItemEntityId>,

Loading…
Cancel
Save