Now we have ODBC .. that accepts various connection string (including SQLite, MySQL,...) And EiffelStore+MySQL. Updated sql scripts to work with MySQL, and SQLite. Added a sql_statement (s: STRING): STRING that converts ROC sql statement to fit the underlying database engine. mostly to adapt incompatibilities such as AUTO_INCREMENT for MySQL and AUTOINCREMENT for SQLite by default SQL script should be written following MySQL SQL syntax. Warning: to use ODBC persistence driver, it has to be installed on the target machine.
33 lines
714 B
SQL
33 lines
714 B
SQL
|
|
CREATE TABLE `users`(
|
|
`uid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
|
`name` VARCHAR(100) NOT NULL,
|
|
`password` VARCHAR(100) NOT NULL,
|
|
`salt` VARCHAR(100) NOT NULL,
|
|
`email` VARCHAR(250) NOT NULL,
|
|
`status` INTEGER,
|
|
`created` DATETIME NOT NULL,
|
|
`signed` DATETIME,
|
|
CONSTRAINT `name`
|
|
UNIQUE(`name`)
|
|
);
|
|
|
|
CREATE TABLE `roles`(
|
|
`rid` INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
|
`name` VARCHAR(100) NOT NULL,
|
|
CONSTRAINT `name`
|
|
UNIQUE(`name`)
|
|
);
|
|
|
|
CREATE TABLE `users_roles`(
|
|
`uid` INTEGER NOT NULL CHECK(`uid`>=0),
|
|
`rid` INTEGER NOT NULL CHECK(`rid`>=0)
|
|
);
|
|
|
|
CREATE TABLE `role_permissions`(
|
|
`rid` INTEGER NOT NULL,
|
|
`permission` VARCHAR(255) NOT NULL,
|
|
`module` VARCHAR(255)
|
|
);
|
|
|