Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB schema #5

Open
kkimu opened this issue Aug 21, 2015 · 1 comment
Open

DB schema #5

kkimu opened this issue Aug 21, 2015 · 1 comment

Comments

@kkimu
Copy link
Contributor

kkimu commented Aug 21, 2015

create table users(
user_id int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_name VARCHAR(64) UNIQUE NOT NULL,
pass VARCHAR(64) NOT NULL
);

create table products(
product_id INTEGER(13) UNIQUE NOT NULL PRIMARY KEY,
product_name VARCHAR(64),
image VARCHAR(64),
price INTEGER(10)
);

create table pois(
poi_id INTEGER(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id INTEGER(8),
product_id INTEGER(13),
date DATETIME NOT NULL,
cap TINYINT(1),
FOREIGN KEY(user_id) REFERENCES users(user_id),
FOREIGN KEY(product_id) REFERENCES products(product_id)
);

@kkimu
Copy link
Contributor Author

kkimu commented Aug 23, 2015

create table users(
user_id int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_name VARCHAR(64) UNIQUE NOT NULL,
pass VARCHAR(64) NOT NULL
);

create table products(
product_id INTEGER(13) UNIQUE NOT NULL PRIMARY KEY,
product_name VARCHAR(64),
image VARCHAR(64),
price INTEGER(10),
kind INTEGER(2)
);

create table pois(
poi_id INTEGER(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id INTEGER(8),
product_id INTEGER(13),
date DATETIME NOT NULL,
cap TINYINT(1),
FOREIGN KEY(user_id) REFERENCES users(user_id),
FOREIGN KEY(product_id) REFERENCES products(product_id)
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant