Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate sqlite #185

Open
zoispag opened this issue Feb 14, 2021 · 0 comments
Open

Investigate sqlite #185

zoispag opened this issue Feb 14, 2021 · 0 comments
Assignees

Comments

@zoispag
Copy link
Member

zoispag commented Feb 14, 2021

CREATE TABLE `sources` (
	`id` INTEGER PRIMARY KEY AUTOINCREMENT,
	`name` TEXT NOT NULL,
	`url` TEXT NOT NULL
);

CREATE TABLE `consoles` (
	`id` INTEGER PRIMARY KEY AUTOINCREMENT,
	`name` TEXT NOT NULL UNIQUE
);

CREATE TABLE `console_source` (
	`id` INTEGER PRIMARY KEY AUTOINCREMENT,
	`console_id` int NOT NULL,
	`source_id` int NOT NULL,
	FOREIGN KEY(console_id) REFERENCES consoles(id),
	FOREIGN KEY(source_id) REFERENCES sources(id)
);

CREATE TABLE `roms` (
	`id` INTEGER PRIMARY KEY AUTOINCREMENT,
	`name` TEXT NOT NULL,
	`console_id` int NOT NULL,
	`language` TEXT NOT NULL,
	`year` int(4),
	`version` TEXT,
	FOREIGN KEY(console_id) REFERENCES consoles(id)
);

CREATE TABLE `rom_urls` (
	`id` INTEGER PRIMARY KEY AUTOINCREMENT,
	`rom_id` bigint NOT NULL,
	`source_id` int NOT NULL,
	`url` TEXT NOT NULL,
	`download_url` TEXT NOT NULL,
	FOREIGN KEY(source_id) REFERENCES sources(id),
	FOREIGN KEY(rom_id) REFERENCES roms(id)
);
@zoispag zoispag self-assigned this Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant