oko-server/server/initdb.sql
zegkljan 862350b875 fix cmdline flags, fix initdb script
* Actually parse the command line flags.
* Remove CASCADE from drop table.
2022-01-28 00:37:22 +01:00

17 lines
435 B
SQL

DROP TABLE IF EXISTS users;
CREATE TABLE IF NOT EXISTS users (
id integer PRIMARY KEY AUTOINCREMENT,
name text NOT NULL UNIQUE
);
INSERT INTO users(id, name) VALUES(0, 'system');
DROP TABLE IF EXISTS features;
CREATE TABLE IF NOT EXISTS features (
id integer PRIMARY KEY AUTOINCREMENT,
owner_id integer REFERENCES users(id) ON DELETE CASCADE,
name text NOT NULL,
description text,
category text,
geom text NOT NULL
);