1 create database if not exists apidb;
5 drop table if exists vendor;
6 drop table if exists appFamily;
7 drop table if exists appVersion;
8 drop table if exists appCategory;
9 drop table if exists appHitStats;
10 drop table if exists catHitStats;
11 drop table if exists appComments;
12 drop table if exists appData;
13 drop table if exists appBundle;
14 drop table if exists appVotes;
15 drop table if exists appNotes;
22 vendorId int not null auto_increment,
23 vendorName varchar(100) not null,
24 vendorURL varchar(200),
25 state enum('accepted','queued','deleted') NOT NULL default 'accepted',
33 create table appFamily (
34 appId int not null auto_increment,
35 appName varchar(100) not null,
36 vendorId int not null,
41 submitTime datetime NOT NULL,
42 submitterId int(11) NOT NULL default '0',
43 state enum('accepted','queued','rejected','deleted') NOT NULL default 'accepted',
48 * a version of an application
50 create table appVersion (
51 versionId int not null auto_increment,
53 versionName varchar(100) not null,
57 submitTime datetime NOT NULL,
58 submitterId int(11) NOT NULL default '0',
59 license enum('Retail','Open Source','Demo','Shareware','Free to use','Free to use and share'),
60 obsoleteBy int(11) NOT NULL default '0',
61 state enum('accepted','queued','rejected','pending','deleted') NOT NULL default 'accepted',
68 * application category
70 create table appCategory (
71 catId int not null auto_increment,
72 catName varchar(64) not null,
74 catParent int default 0,
80 * bundleId is the appId of the 'owner app'
82 create table appBundle (
83 bundleId int not null,
91 * appHitStats and catHitStats are to record statistics
93 create table appHitStats (
94 appHitId int not null auto_increment,
102 create table catHitStats (
103 catHitId int not null auto_increment,
115 create table appComments (
117 commentId int not null auto_increment,
118 parentId int default 0,
119 versionId int not null,
121 hostname varchar(80),
122 subject varchar(128),
131 * links to screenshots and other stuff
133 create table appData (
134 id int not null auto_increment,
136 versionId int default 0,
137 type enum('screenshot', 'url', 'bug','downloadurl'),
139 url varchar(255) default NULL,
140 submitTime datetime NOT NULL,
141 submitterId int(11) NOT NULL default '0',
142 state enum('accepted','queued','rejected') NOT NULL default 'accepted',
144 KEY versionId (versionId)
148 * allow users to vote for apps, as in, request that an app gets better support
150 create table appVotes (
151 id int not null auto_increment,
153 versionId int not null,
165 create table appNotes (
166 noteId int not null auto_increment,
167 noteTitle varchar(255),
169 versionId int not null,
170 submitterId int not null,
171 submitTime datetime not null,