summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-02-08 10:40:35 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2011-02-09 08:46:27 +0100
commit6d737c468454823808d609cfb3b3dc27b0c2ddb3 (patch)
treec73686ad2d5a265f16ab7b66b9f5fbd1803544e6
parent31083dc12dc0dee641169a4b6bc0648576f69ad0 (diff)
downloadaurweb-6d737c468454823808d609cfb3b3dc27b0c2ddb3.tar.xz
Use VARCHAR instead of CHAR where appropriate.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--UPGRADING16
-rw-r--r--support/schema/aur-schema.sql28
2 files changed, 30 insertions, 14 deletions
diff --git a/UPGRADING b/UPGRADING
index c067af5..661a6c3 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -11,6 +11,22 @@ ALTER TABLE Packages ADD OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL;
UPDATE Packages SET OutOfDateTS = UNIX_TIMESTAMP() WHERE OutOfDate = 1;
ALTER TABLE Packages DROP OutOfDate, DROP FSPath, DROP URLPath, DROP LocationID;
DROP TABLE PackageLocations, PackageContents;
+ALTER TABLE AccountTypes MODIFY AccountType VARCHAR(32) NOT NULL DEFAULT '';
+ALTER TABLE Users MODIFY Username VARCHAR(32) NOT NULL,
+ MODIFY Email VARCHAR(64) NOT NULL,
+ MODIFY RealName VARCHAR(64) NOT NULL DEFAULT '',
+ MODIFY LangPreference VARCHAR(5) NOT NULL DEFAULT 'en',
+ MODIFY IRCNick VARCHAR(32) NOT NULL DEFAULT '';
+ALTER TABLE PackageCategories MODIFY Category VARCHAR(32) NOT NULL;
+ALTER TABLE Packages MODIFY Name VARCHAR(64) NOT NULL,
+ MODIFY Version VARCHAR(32) NOT NULL DEFAULT '',
+ MODIFY Description VARCHAR(255) NOT NULL DEFAULT "An Arch Package",
+ MODIFY URL VARCHAR(255) NOT NULL DEFAULT "http://www.archlinux.org",
+ MODIFY License VARCHAR(40) NOT NULL DEFAULT '';
+ALTER TABLE PackageSources
+ MODIFY Source VARCHAR(255) NOT NULL DEFAULT "/dev/null";
+ALTER TABLE TU_VoteInfo
+ MODIFY User VARCHAR(32) collate latin1_general_ci NOT NULL;
----
2. You will need to update all packages which are stored in the incoming dir as
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index cb5ea42..cddf00e 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -9,7 +9,7 @@ USE AUR;
--
CREATE TABLE AccountTypes (
ID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
- AccountType char(32) NOT NULL DEFAULT '',
+ AccountType VARCHAR(32) NOT NULL DEFAULT '',
PRIMARY KEY (ID)
);
INSERT INTO AccountTypes (ID, AccountType) VALUES (1, 'User');
@@ -23,14 +23,14 @@ CREATE TABLE Users (
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
AccountTypeID TINYINT UNSIGNED NOT NULL DEFAULT 1,
Suspended TINYINT UNSIGNED NOT NULL DEFAULT 0,
- Username CHAR(32) NOT NULL,
- Email CHAR(64) NOT NULL,
+ Username VARCHAR(32) NOT NULL,
+ Email VARCHAR(64) NOT NULL,
Passwd CHAR(32) NOT NULL,
Salt CHAR(32) NOT NULL DEFAULT '',
ResetKey CHAR(32) NOT NULL DEFAULT '',
- RealName CHAR(64) NOT NULL DEFAULT '',
- LangPreference CHAR(5) NOT NULL DEFAULT 'en',
- IRCNick CHAR(32) NOT NULL DEFAULT '',
+ RealName VARCHAR(64) NOT NULL DEFAULT '',
+ LangPreference VARCHAR(5) NOT NULL DEFAULT 'en',
+ IRCNick VARCHAR(32) NOT NULL DEFAULT '',
LastVoted BIGINT UNSIGNED NOT NULL DEFAULT 0,
NewPkgNotify TINYINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (ID),
@@ -66,7 +66,7 @@ CREATE TABLE Sessions (
--
CREATE TABLE PackageCategories (
ID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
- Category CHAR(32) NOT NULL,
+ Category VARCHAR(32) NOT NULL,
PRIMARY KEY (ID)
);
INSERT INTO PackageCategories (Category) VALUES ('none');
@@ -93,13 +93,13 @@ INSERT INTO PackageCategories (Category) VALUES ('xfce');
--
CREATE TABLE Packages (
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
- Name CHAR(64) NOT NULL,
- Version CHAR(32) NOT NULL DEFAULT '',
+ Name VARCHAR(64) NOT NULL,
+ Version VARCHAR(32) NOT NULL DEFAULT '',
CategoryID TINYINT UNSIGNED NOT NULL DEFAULT 1,
- Description CHAR(255) NOT NULL DEFAULT "An Arch Package",
- URL CHAR(255) NOT NULL DEFAULT "http://www.archlinux.org",
+ Description VARCHAR(255) NOT NULL DEFAULT "An Arch Package",
+ URL VARCHAR(255) NOT NULL DEFAULT "http://www.archlinux.org",
DummyPkg TINYINT UNSIGNED NOT NULL DEFAULT 0, -- 1=>dummy
- License CHAR(40) NOT NULL DEFAULT '',
+ License VARCHAR(40) NOT NULL DEFAULT '',
NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0,
OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL,
SubmittedTS BIGINT UNSIGNED NOT NULL,
@@ -134,7 +134,7 @@ CREATE TABLE PackageDepends (
--
CREATE TABLE PackageSources (
PackageID INTEGER UNSIGNED NOT NULL,
- Source CHAR(255) NOT NULL DEFAULT "/dev/null",
+ Source VARCHAR(255) NOT NULL DEFAULT "/dev/null",
INDEX (PackageID)
);
@@ -183,7 +183,7 @@ CREATE UNIQUE INDEX NotifyUserIDPkgID ON CommentNotify (UserID, PkgID);
CREATE TABLE IF NOT EXISTS TU_VoteInfo (
ID int(10) unsigned NOT NULL auto_increment,
Agenda text collate latin1_general_ci NOT NULL,
- User char(32) collate latin1_general_ci NOT NULL,
+ User VARCHAR(32) collate latin1_general_ci NOT NULL,
Submitted bigint(20) unsigned NOT NULL,
End bigint(20) unsigned NOT NULL,
SubmitterID int(10) unsigned NOT NULL,