klenwell information services : MysqlSchema

Wiki source for MysqlSchema


Show raw source

=====MySQL Schema=====
return to DevMysql

%%(mysql)
DROP TABLE IF EXISTS my_table;
CREATE TABLE my_table(
-- primary key
id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,

-- types
decimal_ DECIMAL(20,2) DEFAULT 0 ,
int_ INT(11) DEFAULT 0,
text_ TEXT,
time_ TIME,
tinyint_ TINYINT DEFAULT 1,
varchar_ VARCHAR(30) DEFAULT '',

-- common fields
user VARCHAR(200) NOT NULL,
email VARCHAR(200) NOT NULL,
status TINYINT DEFAULT 1,
lastupdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

-- keys, indexes
PRIMARY KEY (id),
index (email),
index (status)
) Engine = InnoDB ;
%%