Logo  

CS479/579 - Web Programming II

Displaying ./code/images/work/newdb.sql

drop table if exists `img_session`;
drop table if exists `img_user`;
drop table if exists `img_image`;

create table `img_session` (
  `sid`		VARCHAR(32)	NOT NULL DEFAULT '',
  `uid`		INT		NOT NULL DEFAULT 0,
  `ipaddr`	VARCHAR(64)	NOT NULL DEFAULT '',
  PRIMARY KEY (`sid`),
  INDEX `uid` (`uid`)
);

create table `img_user` (
  `uid`		INT(12)		NOT NULL AUTO_INCREMENT,
  `email`	VARCHAR(1024)	NOT NULL DEFAULT '',
  `password`	VARCHAR(1024)	NOT NULL DEFAULT '',
  PRIMARY KEY (`uid`),
  INDEX `email` (`email`)
) AUTO_INCREMENT = 1000;

insert into `img_user` (`uid`, `email`, `password`) values ( 1, 'admin', '$6$rounds=5000$salt$MktMKPZJ6t59GfxcJU20DwcwQzfMvOlHFVZiOVD71w.igcOo1R7vBYR65JquIQ/7siC7VRpmteKvZmfSkNc69.');

create table `img_image` (
  `iid`		INT(12)		NOT NULL AUTO_INCREMENT,
  `uid`		INT(12)		NOT NULL DEFAULT 0,
  `location`	VARCHAR(512)	NOT NULL DEFAULT '',
  `name`	VARCHAR(256)	NOT NULL DEFAULT '',
  `meta`	TEXT		NOT NULL DEFAULT '{}',
  `created`	TIMESTAMP	NOT NULL DEFAULT CURRENT_TIMESTAMP(),
  `tags`	TEXT		NOT NULL DEFAULT '[]',
  PRIMARY KEY (`iid`),
  INDEX `uid` (`uid`)
);