Skip to content

Instantly share code, notes, and snippets.

@OrenBochman
Created July 10, 2013 11:42
Show Gist options
  • Save OrenBochman/5965598 to your computer and use it in GitHub Desktop.
Save OrenBochman/5965598 to your computer and use it in GitHub Desktop.
CMS
CREATE TABLE subjects(
id INT(11) NOT NULL AUTO_INCREMENT,
menu_name VARCHAR(30) NOT NULL,
position INT(3) NOT NULL,
visible TINTINT(1) NOT NULL,
PRIMERY KEY(id)
);
CREATE TABLE pages(
id INT(11) NOT NULL AUTO_INCREMENT,
subject_id VARCHAR(30) NOT NULL,
menu_name INT(3) NOT NULL,
position INT(3) NOT NULL,
visible TINTINT(1) NOT NULL,
content TEXT,
PRIMERY KEY(id),
INDEX(subject_id)
);
CREATE TABLE admins(
id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(35) NOT NULL,
hased_password VARCHAR(60 ) NOT NULL,
PRIMARY KEY(id)
);
SHOW TABLEs;
SHOW COLUMNS FROM admins;
subjects
id
menu_name
position
visible
pages
id
subject_id (foreign key)
menu_name
position
visible
content
admins
id
username
hased_password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment