Sha256: fdaf0195e5f621e18adec072ab777d10f12eeeecc7a35029f150f88051232eea

Contents?: true

Size: 1.99 KB

Versions: 179

Compression:

Stored size: 1.99 KB

Contents

USE `ridgepole_test`;

DROP TABLE IF EXISTS `clubs`;
CREATE TABLE `clubs` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_name` (`name`)
);

DROP TABLE IF EXISTS `departments`;
CREATE TABLE `departments` (
  `dept_no` char(4) NOT NULL,
  `dept_name` varchar(40) NOT NULL,
  PRIMARY KEY (`dept_no`),
  UNIQUE KEY `dept_name` (`dept_name`)
);

DROP TABLE IF EXISTS `dept_emp`;
CREATE TABLE `dept_emp` (
  `emp_no` int(11) NOT NULL,
  `dept_no` char(4) NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  PRIMARY KEY (`emp_no`,`dept_no`),
  KEY `emp_no` (`emp_no`),
  KEY `dept_no` (`dept_no`)
);

DROP TABLE IF EXISTS `dept_manager`;
CREATE TABLE `dept_manager` (
  `dept_no` char(4) NOT NULL,
  `emp_no` int(11) NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  PRIMARY KEY (`emp_no`,`dept_no`),
  KEY `emp_no` (`emp_no`),
  KEY `dept_no` (`dept_no`)
);

DROP TABLE IF EXISTS `employee_clubs`;
CREATE TABLE `employee_clubs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `emp_no` int(10) unsigned NOT NULL,
  `club_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_emp_no_club_id` (`emp_no`,`club_id`) USING BTREE
);

DROP TABLE IF EXISTS `employees`;
CREATE TABLE `employees` (
  `emp_no` int(11) NOT NULL,
  `birth_date` date NOT NULL,
  `first_name` varchar(14) NOT NULL,
  `last_name` varchar(16) NOT NULL,
  `gender` enum('M','F') NOT NULL,
  `hire_date` date NOT NULL,
  PRIMARY KEY (`emp_no`)
);

DROP TABLE IF EXISTS `salaries`;
CREATE TABLE `salaries` (
  `emp_no` int(11) NOT NULL,
  `salary` int(11) NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  PRIMARY KEY (`emp_no`,`from_date`),
  KEY `emp_no` (`emp_no`)
);

DROP TABLE IF EXISTS `titles`;
CREATE TABLE `titles` (
  `emp_no` int(11) NOT NULL,
  `title` varchar(50) NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date DEFAULT NULL,
  PRIMARY KEY (`emp_no`,`title`,`from_date`),
  KEY `emp_no` (`emp_no`)
);

Version data entries

179 entries across 179 versions & 1 rubygems

Version Path
ridgepole-0.9.5 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.9.4 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.9.3 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.9.2 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.9.1 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.9.0 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.13 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.9.0.rc1 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.9.0.beta spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.12 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.11 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.10 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.9 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.8 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.7 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.6 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.5 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.4 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.3 spec/mysql/ridgepole_test_tables.sql
ridgepole-0.8.2 spec/mysql/ridgepole_test_tables.sql