Newer
Older
pokemon-go-trade / migration / 1_initial.sql
Simon Lindgren on 22 Feb 2021 699 bytes Added want in db
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE pokemon (
   id INT PRIMARY KEY,
   dex_number INT,
   region varchar(200),
   name VARCHAR(200),
   shiny_enabled boolean,
   shiny_image_name VARCHAR(200),
   image_name VARCHAR(200)
);

CREATE TABLE have_pokemon (
     id SERIAL PRIMARY KEY,
     pokemon_id INT,
     shiny bool
);

CREATE TABLE want_group_pokemon (
      id SERIAL PRIMARY KEY,
      group_name VARCHAR(200)
);

CREATE TABLE want_pokemon (
    id SERIAL PRIMARY KEY,
    pokemon_id INT,
    want_group_id int,
    shiny bool
);

-- +migrate Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE pokemon;