Commit 6d737c46 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Use VARCHAR instead of CHAR where appropriate.


Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 31083dc1
...@@ -11,6 +11,22 @@ ALTER TABLE Packages ADD OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL; ...@@ -11,6 +11,22 @@ ALTER TABLE Packages ADD OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL;
UPDATE Packages SET OutOfDateTS = UNIX_TIMESTAMP() WHERE OutOfDate = 1; UPDATE Packages SET OutOfDateTS = UNIX_TIMESTAMP() WHERE OutOfDate = 1;
ALTER TABLE Packages DROP OutOfDate, DROP FSPath, DROP URLPath, DROP LocationID; ALTER TABLE Packages DROP OutOfDate, DROP FSPath, DROP URLPath, DROP LocationID;
DROP TABLE PackageLocations, PackageContents; 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 2. You will need to update all packages which are stored in the incoming dir as
......
...@@ -9,7 +9,7 @@ USE AUR; ...@@ -9,7 +9,7 @@ USE AUR;
-- --
CREATE TABLE AccountTypes ( CREATE TABLE AccountTypes (
ID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, ID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
AccountType char(32) NOT NULL DEFAULT '', AccountType VARCHAR(32) NOT NULL DEFAULT '',
PRIMARY KEY (ID) PRIMARY KEY (ID)
); );
INSERT INTO AccountTypes (ID, AccountType) VALUES (1, 'User'); INSERT INTO AccountTypes (ID, AccountType) VALUES (1, 'User');
...@@ -23,14 +23,14 @@ CREATE TABLE Users ( ...@@ -23,14 +23,14 @@ CREATE TABLE Users (
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
AccountTypeID TINYINT UNSIGNED NOT NULL DEFAULT 1, AccountTypeID TINYINT UNSIGNED NOT NULL DEFAULT 1,
Suspended TINYINT UNSIGNED NOT NULL DEFAULT 0, Suspended TINYINT UNSIGNED NOT NULL DEFAULT 0,
Username CHAR(32) NOT NULL, Username VARCHAR(32) NOT NULL,
Email CHAR(64) NOT NULL, Email VARCHAR(64) NOT NULL,
Passwd CHAR(32) NOT NULL, Passwd CHAR(32) NOT NULL,
Salt CHAR(32) NOT NULL DEFAULT '', Salt CHAR(32) NOT NULL DEFAULT '',
ResetKey CHAR(32) NOT NULL DEFAULT '', ResetKey CHAR(32) NOT NULL DEFAULT '',
RealName CHAR(64) NOT NULL DEFAULT '', RealName VARCHAR(64) NOT NULL DEFAULT '',
LangPreference CHAR(5) NOT NULL DEFAULT 'en', LangPreference VARCHAR(5) NOT NULL DEFAULT 'en',
IRCNick CHAR(32) NOT NULL DEFAULT '', IRCNick VARCHAR(32) NOT NULL DEFAULT '',
LastVoted BIGINT UNSIGNED NOT NULL DEFAULT 0, LastVoted BIGINT UNSIGNED NOT NULL DEFAULT 0,
NewPkgNotify TINYINT UNSIGNED NOT NULL DEFAULT 0, NewPkgNotify TINYINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (ID), PRIMARY KEY (ID),
...@@ -66,7 +66,7 @@ CREATE TABLE Sessions ( ...@@ -66,7 +66,7 @@ CREATE TABLE Sessions (
-- --
CREATE TABLE PackageCategories ( CREATE TABLE PackageCategories (
ID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, ID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
Category CHAR(32) NOT NULL, Category VARCHAR(32) NOT NULL,
PRIMARY KEY (ID) PRIMARY KEY (ID)
); );
INSERT INTO PackageCategories (Category) VALUES ('none'); INSERT INTO PackageCategories (Category) VALUES ('none');
...@@ -93,13 +93,13 @@ INSERT INTO PackageCategories (Category) VALUES ('xfce'); ...@@ -93,13 +93,13 @@ INSERT INTO PackageCategories (Category) VALUES ('xfce');
-- --
CREATE TABLE Packages ( CREATE TABLE Packages (
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Name CHAR(64) NOT NULL, Name VARCHAR(64) NOT NULL,
Version CHAR(32) NOT NULL DEFAULT '', Version VARCHAR(32) NOT NULL DEFAULT '',
CategoryID TINYINT UNSIGNED NOT NULL DEFAULT 1, CategoryID TINYINT UNSIGNED NOT NULL DEFAULT 1,
Description CHAR(255) NOT NULL DEFAULT "An Arch Package", Description VARCHAR(255) NOT NULL DEFAULT "An Arch Package",
URL CHAR(255) NOT NULL DEFAULT "http://www.archlinux.org", URL VARCHAR(255) NOT NULL DEFAULT "http://www.archlinux.org",
DummyPkg TINYINT UNSIGNED NOT NULL DEFAULT 0, -- 1=>dummy 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, NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0,
OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL, OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL,
SubmittedTS BIGINT UNSIGNED NOT NULL, SubmittedTS BIGINT UNSIGNED NOT NULL,
...@@ -134,7 +134,7 @@ CREATE TABLE PackageDepends ( ...@@ -134,7 +134,7 @@ CREATE TABLE PackageDepends (
-- --
CREATE TABLE PackageSources ( CREATE TABLE PackageSources (
PackageID INTEGER UNSIGNED NOT NULL, PackageID INTEGER UNSIGNED NOT NULL,
Source CHAR(255) NOT NULL DEFAULT "/dev/null", Source VARCHAR(255) NOT NULL DEFAULT "/dev/null",
INDEX (PackageID) INDEX (PackageID)
); );
...@@ -183,7 +183,7 @@ CREATE UNIQUE INDEX NotifyUserIDPkgID ON CommentNotify (UserID, PkgID); ...@@ -183,7 +183,7 @@ CREATE UNIQUE INDEX NotifyUserIDPkgID ON CommentNotify (UserID, PkgID);
CREATE TABLE IF NOT EXISTS TU_VoteInfo ( CREATE TABLE IF NOT EXISTS TU_VoteInfo (
ID int(10) unsigned NOT NULL auto_increment, ID int(10) unsigned NOT NULL auto_increment,
Agenda text collate latin1_general_ci NOT NULL, 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, Submitted bigint(20) unsigned NOT NULL,
End bigint(20) unsigned NOT NULL, End bigint(20) unsigned NOT NULL,
SubmitterID int(10) unsigned NOT NULL, SubmitterID int(10) unsigned NOT NULL,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment