daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
  3.  
  4.  
  5. CREATE TABLE IF NOT EXISTS documents (
  6.   DocumentId int(50) NOT NULL AUTO_INCREMENT,
  7.   Name varchar(100) NOT NULL,
  8.   StepId int(50) NOT NULL,
  9.   Link varchar(500) NOT NULL,
  10.   PRIMARY KEY (DocumentId),
  11.   FOREIGN KEY (StepId) REFERENCES steps(StepId)
  12.   ON DELETE CASCADE
  13. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  14.  
  15.  
  16.  
  17. CREATE TABLE IF NOT EXISTS steps (
  18.   StepId int(50) NOT NULL AUTO_INCREMENT,
  19.   ProcedureId int(50) NOT NULL,
  20.   StepNumber int(50) NOT NULL,
  21.   Documents varchar(500) NOT NULL,
  22.   Descrition varchar(200) NOT NULL,
  23.   PRIMARY KEY (StepId),
  24.   FOREIGN KEY (ProcedureId) REFERENCES procedures(ProcedureId)
  25.   ON DELETE CASCADE
  26. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  27.  
  28.  
  29.  
  30. CREATE TABLE IF NOT EXISTS procedures(
  31.   ProcedureId int(50) NOT NULL AUTO_INCREMENT,
  32.   Name varchar(50) NOT NULL,
  33.   CategoryId varchar(50) NOT NULL,
  34.   Steps varchar(100) NOT NULL,
  35.   PRIMARY KEY (IdProcedure)
  36.   FOREIGN KEY (CategoryId) REFERENCES categories(CategoryId),
  37.   ON DELETE CASCADE
  38. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  39.  
  40.  
  41.  
  42. CREATE TABLE IF NOT EXISTS categories(
  43.   CategoryId int(50) NOT NULL AUTO_INCREMENT,
  44.   Name varchar(50) NOT NULL,
  45.   PRIMARY KEY (IdProcedure)
  46. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
RAW Paste Data
Top