Skip to content

Instantly share code, notes, and snippets.

@vicapow
Created January 11, 2013 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicapow/4513876 to your computer and use it in GitHub Desktop.
Save vicapow/4513876 to your computer and use it in GitHub Desktop.
USE ocal;
DROP TABLE IF EXISTS openclipart_clipart;
-- FILE
CREATE TABLE openclipart_clipart(
id integer NOT NULL auto_increment,
filename varchar(255),
owner integer NOT NULL,
PRIMARY KEY(id),
FOREIGN KEY(owner) REFERENCES openclipart_users(id)
);
DROP TABLE IF EXISTS openclipart_users;
-- USERS
CREATE TABLE openclipart_users(
id integer NOT NULL auto_increment,
username varchar(255) UNIQUE,
PRIMARY KEY(id),
FOREIGN KEY(avatar) REFERENCES openclipart_clipart(id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment