kozukata-toa/src/external/db/drizzle/0000_ambitious_gorilla_man.sql

48 lines
2.1 KiB
SQL

CREATE TABLE `aimedb_felica_card_lookup` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`idm` text(16) NOT NULL,
`access_code` text(20) NOT NULL
);
--> statement-breakpoint
CREATE TABLE `aimedb_felica_mobile_lookup` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`idm` text(16) NOT NULL,
`access_code` text(20) NOT NULL
);
--> statement-breakpoint
CREATE TABLE `allnet_arcade` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` text(60) DEFAULT 'Random arcade at nowhere',
`nickname` text(40) DEFAULT 'Please send help',
`country` text(3) DEFAULT 'JPN',
`region_id` integer DEFAULT 1,
`region_name0` text(48) DEFAULT 'W',
`region_name1` text(48) DEFAULT '',
`region_name2` text(48) DEFAULT '',
`region_name3` text(48) DEFAULT '',
`utc_offset` real DEFAULT 9
);
--> statement-breakpoint
CREATE TABLE `allnet_arcade_ip` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`arcade_id` integer,
`ip` text(15),
FOREIGN KEY (`arcade_id`) REFERENCES `allnet_arcade`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `allnet_machine` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`arcade_id` integer,
`serial` text(11),
`game` text(5),
`can_venue_hop` integer,
`last_authenticated` integer,
FOREIGN KEY (`arcade_id`) REFERENCES `allnet_arcade`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE UNIQUE INDEX `aimedb_felica_card_lookup_idm_unique` ON `aimedb_felica_card_lookup` (`idm`);--> statement-breakpoint
CREATE UNIQUE INDEX `aimedb_felica_card_lookup_access_code_unique` ON `aimedb_felica_card_lookup` (`access_code`);--> statement-breakpoint
CREATE UNIQUE INDEX `aimedb_felica_mobile_lookup_idm_unique` ON `aimedb_felica_mobile_lookup` (`idm`);--> statement-breakpoint
CREATE UNIQUE INDEX `aimedb_felica_mobile_lookup_access_code_unique` ON `aimedb_felica_mobile_lookup` (`access_code`);--> statement-breakpoint
CREATE UNIQUE INDEX `allnet_arcade_ip_ip_unique` ON `allnet_arcade_ip` (`ip`);--> statement-breakpoint
CREATE UNIQUE INDEX `allnet_machine_serial_unique` ON `allnet_machine` (`serial`);