pruvodce/db/schema.sql

58 lines
1.7 KiB
SQL

-- Adminer 4.7.5 SQLite 3 dump
CREATE TABLE "events" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" text NOT NULL,
"slug" text NOT NULL,
"subtitle" text NULL,
"text" integer NULL,
"datetime" integer NOT NULL,
"facebook_url" text NULL,
"lon" integer NOT NULL,
"lat" integer NOT NULL,
"place_description" text NULL,
"stop_ids" text NULL,
"is_future" integer NOT NULL DEFAULT '1'
);
CREATE UNIQUE INDEX "events_slug" ON "events" ("slug");
CREATE TABLE "poi" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"slug" text NOT NULL,
"lon" real NOT NULL,
"lat" real NOT NULL,
"name" text NOT NULL,
"description" text NOT NULL,
"cheatsheet" text NOT NULL,
"internal" text NOT NULL,
"is_public" integer NOT NULL DEFAULT '0'
);
CREATE UNIQUE INDEX "poi_slug" ON "poi" ("slug");
CREATE TABLE "users" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"member_id" integer NULL,
"username" text NOT NULL,
"password" text NOT NULL,
"name" text NOT NULL,
"note" text DEFAULT NULL,
"is_active" integer NOT NULL DEFAULT '1',
"is_superuser" integer NOT NULL DEFAULT '0'
);
CREATE UNIQUE INDEX "users_usename" ON "users" ("username");
INSERT INTO "users" ("id", "member_id", "username", "password", "name", "note", "is_active", "is_superuser") VALUES (1, NULL, 'severak', '$2y$10$G//hwvWHJYNHFk6JNr3GG.kuzM/dI9UTtU2bxr9EvTTEg0YOc8mj.', 'Severák', '(testovací účet)', 1, 1);
CREATE TABLE "trasy" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" integer NOT NULL,
"cheatsheet" text NULL,
"stop_ids" integer NULL
);
--