kozukata-toa/src/external/db/drizzle/0001_modern_stryfe.sql

29 lines
961 B
SQL

CREATE TABLE `aimedb_card` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` integer,
`access_code` text(20) NOT NULL,
`created_date` integer NOT NULL,
`last_login_date` integer NOT NULL,
`is_locked` integer DEFAULT false NOT NULL,
`is_banned` integer DEFAULT false NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `aimedb_user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `aimedb_user` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`created_date` integer NOT NULL,
`last_login_date` integer NOT NULL,
`suspend_expiration_date` integer
);
--> statement-breakpoint
CREATE TABLE `event_log` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`timestamp` integer NOT NULL,
`system` text NOT NULL,
`type` text NOT NULL,
`severity` text NOT NULL,
`message` text,
`details` text
);
--> statement-breakpoint
CREATE UNIQUE INDEX `aimedb_card_access_code_unique` ON `aimedb_card` (`access_code`);