Permalink
Cannot retrieve contributors at this time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
{ | |
"name": "crud", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"dev": "nodemon server.js" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"body-parser": "^1.18.3", | |
"cors": "^2.8.5", | |
"ejs": "^2.6.1", | |
"express": "^4.16.4", | |
"mysql2": "^1.5.3", | |
"sequelize": "^4.38.0", | |
"sequelize-cli": "^4.0.0", | |
"sequelize-mysql-set-timezone-fix": "^3.13.1", | |
"swagger-node-express": "^2.1.3", | |
"swagger-ui-dist": "^3.20.1" | |
}, | |
"devDependencies": { | |
"nodemon": "^1.18.7" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
-- MySQL Script generated by MySQL Workbench | |
-- Wed Jul 31 21:02:04 2019 | |
-- Model: New Model Version: 1.0 | |
-- MySQL Workbench Forward Engineering | |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; | |
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; | |
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; | |
-- ----------------------------------------------------- | |
-- Schema crud | |
-- ----------------------------------------------------- | |
DROP SCHEMA IF EXISTS `crud` ; | |
-- ----------------------------------------------------- | |
-- Schema crud | |
-- ----------------------------------------------------- | |
CREATE SCHEMA IF NOT EXISTS `crud` DEFAULT CHARACTER SET utf8 ; | |
USE `crud` ; | |
-- ----------------------------------------------------- | |
-- Table `crud`.`profiles` | |
-- ----------------------------------------------------- | |
DROP TABLE IF EXISTS `crud`.`profiles` ; | |
CREATE TABLE IF NOT EXISTS `crud`.`profiles` [ | |
`profile_id` INT NOT NULL, | |
`name` VARCHAR[50] NOT NULL, | |
PRIMARY KEY [`profile_id`]] | |
ENGINE = InnoDB; | |
-- ----------------------------------------------------- | |
-- Table `crud`.`users` | |
-- ----------------------------------------------------- | |
DROP TABLE IF EXISTS `crud`.`users` ; | |
CREATE TABLE IF NOT EXISTS `crud`.`users` [ | |
`user_id` INT NOT NULL AUTO_INCREMENT, | |
`profile_id` INT NOT NULL, | |
`name` VARCHAR[100] NOT NULL, | |
`is_active` TINYINT[1] NOT NULL, | |
PRIMARY KEY [`user_id`], | |
INDEX `profile_id_users_idx` [`profile_id` ASC], | |
CONSTRAINT `profile_id_users` | |
FOREIGN KEY [`profile_id`] | |
REFERENCES `crud`.`profiles` [`profile_id`] | |
ON DELETE NO ACTION | |
ON UPDATE NO ACTION] | |
ENGINE = InnoDB; | |
SET SQL_MODE=@OLD_SQL_MODE; | |
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; | |
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; | |
-- ----------------------------------------------------- | |
-- Data for table `crud`.`profiles` | |
-- ----------------------------------------------------- | |
START TRANSACTION; | |
USE `crud`; | |
INSERT INTO `crud`.`profiles` [`profile_id`, `name`] VALUES [1, 'ADMIN']; | |
INSERT INTO `crud`.`profiles` [`profile_id`, `name`] VALUES [2, 'CLIENT']; | |
COMMIT; | |