diff options
Diffstat (limited to 'support/schema')
-rw-r--r-- | support/schema/aur-schema.sql | 9 | ||||
-rw-r--r-- | support/schema/dummy-data.sql.bz2 | bin | 0 -> 687869 bytes | |||
-rw-r--r-- | support/schema/dummy-data.sql.gz | bin | 77962 -> 0 bytes | |||
-rwxr-xr-x | support/schema/gendummydata.py | 24 |
4 files changed, 19 insertions, 14 deletions
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 876cf28..dd02310 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -113,8 +113,9 @@ CREATE TABLE Packages ( NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, OutOfDate TINYINT UNSIGNED DEFAULT 0, SubmittedTS BIGINT UNSIGNED NOT NULL, - SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, - MaintainerUID INTEGER UNSIGNED NOT NULL DEFAULT 0, + SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it? + MaintainerUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- User + AURMaintainerUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- TU/Dev PRIMARY KEY (ID), UNIQUE (Name), INDEX (CategoryID), @@ -123,10 +124,12 @@ CREATE TABLE Packages ( INDEX (NumVotes), INDEX (SubmitterUID), INDEX (MaintainerUID), + INDEX (AURMaintainerUID), FOREIGN KEY (CategoryID) REFERENCES PackageCategories(ID) ON DELETE NO ACTION, FOREIGN KEY (LocationID) REFERENCES PackageLocations(ID) ON DELETE NO ACTION, FOREIGN KEY (SubmitterUID) REFERENCES Users(ID) ON DELETE NO ACTION, - FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE NO ACTION + FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE NO ACTION, + FOREIGN KEY (AURMaintainerUID) REFERENCES Users(ID) ON DELETE NO ACTION ); diff --git a/support/schema/dummy-data.sql.bz2 b/support/schema/dummy-data.sql.bz2 Binary files differnew file mode 100644 index 0000000..1b5bde3 --- /dev/null +++ b/support/schema/dummy-data.sql.bz2 diff --git a/support/schema/dummy-data.sql.gz b/support/schema/dummy-data.sql.gz Binary files differdeleted file mode 100644 index 296b8aa..0000000 --- a/support/schema/dummy-data.sql.gz +++ /dev/null diff --git a/support/schema/gendummydata.py b/support/schema/gendummydata.py index 7365296..917b569 100755 --- a/support/schema/gendummydata.py +++ b/support/schema/gendummydata.py @@ -13,15 +13,15 @@ DB_HOST = "localhost" DB_NAME = "AUR" DB_USER = "aur" DB_PASS = "aur" -USER_ID = 5 # Users.ID of first user -PKG_ID = 1 # Packages.ID of first package -MAX_USERS = 1000 # how many users to 'register' -MAX_DEVS = .1 # what percentage of MAX_USERS are Developers -MAX_TUS = .2 # what percentage of MAX_USERS are Trusted Users -MAX_PKGS = 2500 # how many packages to load -PKG_FILES = (8, 30) # min/max number of files in a package -VOTING = (.1, .4) # percentage range for package voting -RANDOM_PATHS = [ # random path locations for package files +USER_ID = 5 # Users.ID of first user +PKG_ID = 1 # Packages.ID of first package +MAX_USERS = 500 # how many users to 'register' +MAX_DEVS = .1 # what percentage of MAX_USERS are Developers +MAX_TUS = .2 # what percentage of MAX_USERS are Trusted Users +MAX_PKGS = 2500 # how many packages to load +PKG_FILES = (8, 30) # min/max number of files in a package +VOTING = (0, .30) # percentage range for package voting +RANDOM_PATHS = [ # random path locations for package files "/usr/bin", "/usr/lib", "/etc", "/etc/rc.d", "/usr/share", "/lib", "/var/spool", "/var/log", "/usr/sbin", "/opt", "/usr/X11R6/bin", "/usr/X11R6/lib", "/usr/libexec", "/usr/man/man1", "/usr/man/man3", @@ -225,8 +225,10 @@ for p in seen_pkgs.keys(): if location_id == 1: # unsupported pkgs don't have a maintainer muid = 0 - s = "INSERT INTO Packages (ID, Name, Version, CategoryID, LocationID, SubmittedTS, SubmitterUID, MaintainerUID) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d);\n" % (seen_pkgs[p], p, genVersion(location_id), genCategory(), - location_id, long(time.time()), genUID(), muid) + uuid = genUID() # the submitter/user + + s = "INSERT INTO Packages (ID, Name, Version, CategoryID, LocationID, SubmittedTS, SubmitterUID, MaintainerUID, AURMaintainerUID) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d, %d);\n" % (seen_pkgs[p], p, genVersion(location_id), + genCategory(), location_id, long(time.time()), uuid, uuid, muid) out.write(s) if count % 100 == 0: if DBUG: print ".", |