Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

setup.sql 531B

12345678910111213141516171819202122
  1. CREATE TABLE users (
  2. id SERIAL PRIMARY KEY,
  3. username VARCHAR(64) UNIQUE NOT NULL,
  4. pass_hash CHAR(128) NOT NULL,
  5. date_created TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT NOW()
  6. );
  7. CREATE TABLE collections (
  8. id SERIAL PRIMARY KEY,
  9. name VARCHAR(64),
  10. user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE
  11. );
  12. CREATE TABLE images (
  13. id SERIAL PRIMARY KEY,
  14. name VARCHAR(64) NOT NULL,
  15. description TEXT,
  16. extension VARCHAR(16) NOT NULL,
  17. collection_id INTEGER NOT NULL REFERENCES collections(id) ON DELETE CASCADE
  18. );