gtsrssapi/lib/GTSRSSApi/DB/Migrations.pm

59 lines
1.5 KiB
Perl

package GTSRSSApi::DB::Migrations;
use v5.34.1;
use strict;
use warnings;
use utf8;
use feature 'signatures';
sub MIGRATIONS {
return (
'CREATE TABLE options (
name TEXT PRIMARY KEY,
value TEXT
);',
'CREATE TABLE offers (
uuid UUID PRIMARY KEY,
date timestamp NOT NULL,
species TEXT NOT NULL,
offerer TEXT NOT NULL,
nickname TEXT NOT NULL,
level NUMERIC NOT NULL,
nature TEXT NOT NULL,
ability TEXT NOT NULL,
is_shiny boolean NOT NULL,
has_pokerus boolean NOT NULL,
wanted_species TEXT NOT NULL,
wanted_requirements TEXT NOT NULL,
gender TEXT,
pokeball TEXT,
held_item TEXT
)',
'ALTER TABLE offers ADD COLUMN is_available BOOLEAN NOT NULL DEFAULT true;',
'ALTER TABLE offers ADD COLUMN marked_to_check_is_available BOOLEAN NOT NULL DEFAULT false;',
'CREATE TABLE news (
uuid UUID PRIMARY KEY,
date timestamp NOT NULL,
species TEXT NOT NULL,
offerer TEXT NOT NULL,
is_shiny boolean NOT NULL,
has_pokerus boolean NOT NULL,
news_text TEXT NOT NULL,
held_item TEXT
);',
'CREATE TABLE news_computer (
uuid UUID PRIMARY KEY,
date timestamp NOT NULL,
species TEXT NOT NULL,
offerer TEXT NOT NULL,
is_shiny boolean NOT NULL,
has_pokerus boolean NOT NULL,
news_text TEXT NOT NULL,
held_item TEXT
);',
);
}
1;