2023-12-04 15:14:33 +00:00
|
|
|
CREATE SCHEMA IF NOT EXISTS coach_scraper;
|
|
|
|
|
2023-12-04 22:08:17 +00:00
|
|
|
DROP TABLE IF EXISTS coach_scraper.export;
|
|
|
|
|
|
|
|
CREATE TABLE coach_scraper.export
|
2023-12-04 15:14:33 +00:00
|
|
|
( id SERIAL PRIMARY KEY
|
|
|
|
, site VARCHAR(16) NOT NULL
|
2023-12-04 15:17:24 +00:00
|
|
|
, username VARCHAR(255) NOT NULL
|
2023-12-04 22:08:17 +00:00
|
|
|
, name VARCHAR(255)
|
|
|
|
, image_url TEXT
|
2023-12-05 21:20:46 +00:00
|
|
|
, languages TEXT[]
|
2023-12-04 15:14:33 +00:00
|
|
|
, rapid INT
|
|
|
|
, blitz INT
|
|
|
|
, bullet INT
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS
|
|
|
|
site_username_unique
|
|
|
|
ON
|
|
|
|
coach_scraper.export
|
|
|
|
USING
|
|
|
|
BTREE (site, username);
|
2023-12-05 22:15:42 +00:00
|
|
|
|
|
|
|
DROP TABLE IF EXISTS coach_scraper.languages;
|
|
|
|
|
|
|
|
CREATE TABLE coach_scraper.languages
|
|
|
|
( id SERIAL PRIMARY KEY
|
|
|
|
, code VARCHAR(8) NOT NULL
|
|
|
|
, name VARCHAR(128) NOT NULL
|
2023-12-05 23:06:04 +00:00
|
|
|
, pos INTEGER NOT NULL
|
2023-12-05 22:15:42 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS
|
|
|
|
code_unique
|
|
|
|
ON
|
|
|
|
coach_scraper.languages
|
|
|
|
USING
|
|
|
|
BTREE (code);
|