nidus-sync/db/migrations/00001_initial.sql

40 lines
799 B
MySQL
Raw Normal View History

2025-11-04 23:11:32 +00:00
-- +goose Up
CREATE TYPE ArcgisLicenseType AS ENUM (
2025-11-04 23:11:32 +00:00
'advancedUT',
'basicUT',
'creatorUT',
'editorUT',
'fieldWorkerUT',
'GISProfessionalAdvUT',
'GISProfessionalBasicUT',
'GISProfessionalStdUT',
'IndoorsUserUT',
'insightsAnalystUT',
'liteUT',
'standardUT',
'storytellerUT',
'viewerUT');
CREATE TABLE organization (
id SERIAL PRIMARY KEY,
name TEXT
);
CREATE TABLE user_ (
id SERIAL PRIMARY KEY,
arcgis_access_token TEXT,
arcgis_license ArcgisLicenseType,
2025-11-04 23:11:32 +00:00
arcgis_refresh_token TEXT,
arcgis_refresh_token_expires TIMESTAMP,
arcgis_role TEXT,
display_name VARCHAR(200) NOT NULL,
2025-11-04 23:11:32 +00:00
email TEXT,
organization_id INTEGER REFERENCES organization (id),
username TEXT NOT NULL
);
-- +goose Down
DROP TABLE user_;
DROP TABLE organization;
DROP TYPE arcgis_license_type;