Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
- CREATE TABLE IF NOT EXISTS documents (
- DocumentId int(50) NOT NULL AUTO_INCREMENT,
- Name varchar(100) NOT NULL,
- StepId int(50) NOT NULL,
- Link varchar(500) NOT NULL,
- PRIMARY KEY (DocumentId),
- FOREIGN KEY (StepId) REFERENCES steps(StepId)
- ON DELETE CASCADE
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
- CREATE TABLE IF NOT EXISTS steps (
- StepId int(50) NOT NULL AUTO_INCREMENT,
- ProcedureId int(50) NOT NULL,
- StepNumber int(50) NOT NULL,
- Documents varchar(500) NOT NULL,
- Descrition varchar(200) NOT NULL,
- PRIMARY KEY (StepId),
- FOREIGN KEY (ProcedureId) REFERENCES procedures(ProcedureId)
- ON DELETE CASCADE
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
- CREATE TABLE IF NOT EXISTS procedures(
- ProcedureId int(50) NOT NULL AUTO_INCREMENT,
- Name varchar(50) NOT NULL,
- CategoryId varchar(50) NOT NULL,
- Steps varchar(100) NOT NULL,
- PRIMARY KEY (IdProcedure)
- FOREIGN KEY (CategoryId) REFERENCES categories(CategoryId),
- ON DELETE CASCADE
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
- CREATE TABLE IF NOT EXISTS categories(
- CategoryId int(50) NOT NULL AUTO_INCREMENT,
- Name varchar(50) NOT NULL,
- PRIMARY KEY (IdProcedure)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Add Comment
Please, Sign In to add comment