FIX: add autoincrement to all ID fields

This commit is contained in:
Michal Kváček
2016-01-26 21:54:10 +01:00
parent cdde6bcb33
commit 1a0c7e0b27
+9 -9
View File
@@ -1,5 +1,5 @@
-- MySQL Script generated by MySQL Workbench
-- Út 26. leden 2016, 21:33:51 CET
-- Út 26. leden 2016, 21:53:01 CET
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
@@ -45,7 +45,7 @@ ENGINE = InnoDB;
-- Table `files`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `files` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` INT NOT NULL COMMENT 'User, who uploaded this file',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`filename` VARCHAR(128) NOT NULL,
@@ -66,7 +66,7 @@ COMMENT = 'Table containing files which were uploaded into system.';
-- Table `contents`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `contents` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` INT NOT NULL,
`module_handler` VARCHAR(255) NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -111,7 +111,7 @@ COMMENT = 'Table with all content pages.';
-- Table `content_history`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `content_history` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` INT NOT NULL,
`content_id` INT NOT NULL,
`changed_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -154,7 +154,7 @@ COMMENT = 'Widget type table contains information about all installed widgets. T
-- Table `widgets`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `widgets` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`widget_type_handler` VARCHAR(255) NOT NULL,
`user_id` INT NOT NULL COMMENT 'User ID who created this widget',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -223,7 +223,7 @@ ENGINE = InnoDB;
-- Table `custom_field_types`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `custom_field_types` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NOT NULL COMMENT 'Name of custom field. Given as a translation string (e.g. as dir/section.translation)',
`handler` VARCHAR(255) NOT NULL COMMENT 'Class for handling this type of custom field',
PRIMARY KEY (`id`),
@@ -237,7 +237,7 @@ COMMENT = 'List of all custom field types.';
-- Table `custom_fields`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `custom_fields` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(128) NOT NULL,
`type_id` INT NOT NULL COMMENT 'Foreign key to custom_field_types table',
`description` MEDIUMTEXT NULL DEFAULT NULL COMMENT 'Description used for detailed information about meaning of given custom field',
@@ -307,7 +307,7 @@ COMMENT = 'Table used for assigning different custom fields to different modules
-- Table `action_log_types`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `action_log_types` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(128) NOT NULL,
`value` VARCHAR(128) NOT NULL COMMENT 'Log content - represented as translation string.',
PRIMARY KEY (`id`))
@@ -319,7 +319,7 @@ COMMENT = 'List of all types which can be logged.';
-- Table `action_log`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `action_log` (
`id` INT NOT NULL,
`id` INT NOT NULL AUTO_INCREMENT,
`type_id` INT NOT NULL,
`user_id` INT NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,