Просмотр исходного кода

Update database schema

tags/v2.0
Skylar Ittner 1 год назад
Родитель
Сommit
3d309ac68b
3 измененных файлов: 20 добавлений и 2 удалений
  1. Двоичные данные
      database.mwb
  2. 9
    1
      database.sql
  3. 11
    1
      database_upgrade/1.0.1_1.1.sql

Двоичные данные
database.mwb Просмотреть файл


+ 9
- 1
database.sql Просмотреть файл

@@ -1,5 +1,5 @@
-- MySQL Script generated by MySQL Workbench
-- Mon 21 May 2018 04:05:27 PM MDT
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering

@@ -51,6 +51,7 @@ CREATE TABLE IF NOT EXISTS `accounthub`.`accounts` (
`realname` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NULL DEFAULT 'NOEMAIL@EXAMPLE.COM',
`authsecret` VARCHAR(100) NULL,
`pin` VARCHAR(10) NULL,
`phone1` VARCHAR(45) NOT NULL,
`phone2` VARCHAR(45) NOT NULL,
`acctstatus` INT NOT NULL DEFAULT 0,
@@ -252,7 +253,8 @@ ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `accounthub`.`mobile_codes` (
`codeid` INT NOT NULL AUTO_INCREMENT,
`uid` INT NOT NULL,
`code` VARCHAR(45) NULL,
`code` VARCHAR(45) NOT NULL DEFAULT '',
`description` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`codeid`),
UNIQUE INDEX `codeid_UNIQUE` (`codeid` ASC),
INDEX `fk_mobile_codes_accounts1_idx` (`uid` ASC),
@@ -366,6 +368,11 @@ INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (301, 'QWIKCLOCK_MANAGE', 'Edit punches and other data for managed users');
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (302, 'QWIKCLOCK_EDITSELF', 'Edit own punches and other data');
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (303, 'QWIKCLOCK_ADMIN', 'Add and edit shifts and other data for all users');
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (400, 'SITEWRITER', 'Manage and edit websites, messages, and analytics');
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (401, 'SITEWRITER_CONTACT', 'Manage messages sent via website contact forms');
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (402, 'SITEWRITER_ANALYTICS', 'View website analytics');
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (403, 'SITEWRITER_EDIT', 'Edit website content');
INSERT INTO `accounthub`.`permissions` (`permid`, `permcode`, `perminfo`) VALUES (404, 'SITEWRITER_FILES', 'Manage and upload files');

COMMIT;


+ 11
- 1
database_upgrade/1.0.1_1.1.sql Просмотреть файл

@@ -19,4 +19,14 @@ CHANGE COLUMN `groupid` `groupid` INT(11) NOT NULL AUTO_INCREMENT;
SET FOREIGN_KEY_CHECKS = 1;

ALTER TABLE `accounts`
ADD COLUMN `pin` VARCHAR(10) NULL DEFAULT NULL AFTER `authsecret`;
ADD COLUMN `pin` VARCHAR(10) NULL DEFAULT NULL AFTER `authsecret`;

ALTER TABLE `mobile_codes`
CHANGE COLUMN `code` `code` VARCHAR(45) NOT NULL DEFAULT '',
ADD COLUMN `description` VARCHAR(255) NOT NULL DEFAULT '' AFTER `code`;

INSERT INTO `permissions` (`permid`, `permcode`, `perminfo`) VALUES (400, 'SITEWRITER', 'Manage and edit websites, messages, and analytics');
INSERT INTO `permissions` (`permid`, `permcode`, `perminfo`) VALUES (401, 'SITEWRITER_CONTACT', 'Manage messages sent via website contact forms');
INSERT INTO `permissions` (`permid`, `permcode`, `perminfo`) VALUES (402, 'SITEWRITER_ANALYTICS', 'View website analytics');
INSERT INTO `permissions` (`permid`, `permcode`, `perminfo`) VALUES (403, 'SITEWRITER_EDIT', 'Edit website content');
INSERT INTO `permissions` (`permid`, `permcode`, `perminfo`) VALUES (404, 'SITEWRITER_FILES', 'Manage and upload files');

Загрузка…
Отмена
Сохранить