Skip to content

Commit

Permalink
Rename migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
ufame committed May 22, 2023
1 parent 10bab37 commit 7e4314f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions migrations/create_tables.sql
@@ -0,0 +1,29 @@
CREATE TABLE IF NOT EXISTS `pp_players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`authid` varchar(36) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY (`authid`)
) CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE TABLE IF NOT EXISTS `pp_keys` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(64) NOT NULL,
`default_value` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY (`key`)
) CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE TABLE IF NOT EXISTS `pp_preferences` (
`player_id` int(11) NOT NULL,
`key_id` int(11) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`player_id`, `key_id`),

FOREIGN KEY (`player_id`)
REFERENCES `pp_players`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE,

FOREIGN KEY (`key_id`)
REFERENCES `pp_keys`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE
) CHARACTER SET utf8 COLLATE utf8_general_ci;

0 comments on commit 7e4314f

Please sign in to comment.