# migrations

name: messages-table
up:
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------

  create table messages
  (
      id               integer
          constraint messages_pk
              primary key,
      guild            integer not null,
      channel          integer not null,
      author           text not null,
      content          text,
      reaction_1_count integer not null default 0,
      reaction_2_count integer not null default 0,
      reaction_3_count integer not null default 0
  );

  --------------------------------------------------------------------------------

down:
  --------------------------------------------------------------------------------

  DROP TABLE messages;


name: users-table
down:
  --------------------------------------------------------------------------------

  DROP TABLE users;

up:
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------

  create table users
  (
      id               text
          constraint users_pk
              primary key,
      username    text not null,
      reaction_1_total integer not null default 0,
      reaction_2_total integer not null default 0,
      reaction_3_total integer not null default 0
  );

  --------------------------------------------------------------------------------


