use char instead of varchar

This commit is contained in:
Graham Knop 2009-02-18 03:18:20 +00:00
parent c90fa56507
commit e5ede77c29
17 changed files with 31 additions and 31 deletions

View file

@ -130,13 +130,13 @@ sub addThing {
}
$db->write("create table ".$db->dbh->quote_identifier("Thingy_".$newThingId)."(
thingDataId varchar(22) binary not null,
thingDataId CHAR(22) binary not null,
dateCreated int not null,
createdById varchar(22) not null,
updatedById varchar(22) not null,
updatedByName varchar(255) not null,
createdById CHAR(22) not null,
updatedById CHAR(22) not null,
updatedByName CHAR(255) not null,
lastUpdated int not null,
ipAddress varchar(255),
ipAddress CHAR(255),
primary key (thingDataId)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
@ -591,7 +591,7 @@ sub _getDbDataType {
my ($dbDataType, $formClass);
if ($fieldType =~ m/^otherThing/x){
$dbDataType = "varchar(22)";
$dbDataType = "CHAR(22)";
}
else{
$formClass = 'WebGUI::Form::' . ucfirst $fieldType;

View file

@ -64,7 +64,7 @@ sub install {
my $sql
= q{CREATE TABLE `}
. $installDef->{tableName} . q{` ( }
. q{`assetId` VARCHAR(22) BINARY NOT NULL, }
. q{`assetId` CHAR(22) BINARY NOT NULL, }
. q{`revisionDate` BIGINT NOT NULL, };
for my $column ( keys %{ $installDef->{properties} } ) {
my $control = WebGUI::Form::DynamicField->new( $session, %{ $installDef->{properties}->{$column} } );

View file

@ -209,7 +209,7 @@ sub crud_createTable {
my $tableName = $class->crud_getTableName($session);
$class->crud_dropTable($session);
$db->write('create table '.$dbh->quote_identifier($tableName).' (
'.$dbh->quote_identifier($class->crud_getTableKey($session)).' varchar(22) binary not null primary key,
'.$dbh->quote_identifier($class->crud_getTableKey($session)).' CHAR(22) binary not null primary key,
sequenceNumber int not null default 1,
dateCreated datetime,
lastUpdated datetime

View file

@ -102,12 +102,12 @@ sub definition {
=head2 getDatabaseFieldType ( )
Returns "VARCHAR(22) BINARY".
Returns "CHAR(22) BINARY".
=cut
sub getDatabaseFieldType {
return "VARCHAR(22) BINARY";
return "CHAR(22) BINARY";
}
#-------------------------------------------------------------------

View file

@ -40,12 +40,12 @@ The following methods are specifically available from this class. Check the supe
=head2 getDatabaseFieldType ( )
Returns "VARCHAR(7)".
Returns "CHAR(7)".
=cut
sub getDatabaseFieldType {
return "VARCHAR(7)";
return "CHAR(7)";
}
#-------------------------------------------------------------------

View file

@ -358,12 +358,12 @@ sub get {
=head2 getDatabaseFieldType ( )
A class method that tells you what database field type this form field should be stored in. Defaults to "VARCHAR(255)".
A class method that tells you what database field type this form field should be stored in. Defaults to "CHAR(255)".
=cut
sub getDatabaseFieldType {
return "VARCHAR(255)";
return "CHAR(255)";
}

View file

@ -92,12 +92,12 @@ sub definition {
=head2 getDatabaseFieldType ( )
Returns "VARCHAR(22) BINARY".
Returns "CHAR(22) BINARY".
=cut
sub getDatabaseFieldType {
return "VARCHAR(22) BINARY";
return "CHAR(22) BINARY";
}
#-------------------------------------------------------------------

View file

@ -96,12 +96,12 @@ sub definition {
=head2 getDatabaseFieldType ( )
Returns "VARCHAR(16)".
Returns "CHAR(16)".
=cut
sub getDatabaseFieldType {
return "VARCHAR(16)";
return "CHAR(16)";
}
#-------------------------------------------------------------------

View file

@ -71,12 +71,12 @@ sub definition {
=head2 getDatabaseFieldType ( )
Returns "VARCHAR(255)".
Returns "CHAR(255)".
=cut
sub getDatabaseFieldType {
return "VARCHAR(255)";
return "CHAR(255)";
}
#-------------------------------------------------------------------

View file

@ -86,12 +86,12 @@ sub definition {
=head2 getDatabaseFieldType ( )
Returns "VARCHAR(22) BINARY".
Returns "CHAR(22) BINARY".
=cut
sub getDatabaseFieldType {
return "VARCHAR(22) BINARY";
return "CHAR(22) BINARY";
}
#-------------------------------------------------------------------

View file

@ -88,12 +88,12 @@ sub definition {
=head2 getDatabaseFieldType ( )
Returns "VARCHAR(22) BINARY".
Returns "CHAR(22) BINARY".
=cut
sub getDatabaseFieldType {
return "VARCHAR(22) BINARY";
return "CHAR(22) BINARY";
}
#-------------------------------------------------------------------

View file

@ -53,4 +53,4 @@ sub process {
return $user->profileField($field);
}
1;
1;

View file

@ -154,4 +154,4 @@ sub www_viewInboxMessage {
return $instance->displayContent($instance->callMethod("viewMessage"));
}
1;
1;