modern linux
This commit is contained in:
parent
abaa483aa3
commit
67b881f4cf
1 changed files with 54 additions and 18 deletions
|
|
@ -37,8 +37,44 @@ addRegistrationSteps( $session );
|
|||
addConfirmationTemplateColumn( $session );
|
||||
addSentToIndex( $session );
|
||||
addUseHoneypotColumn( $session );
|
||||
addDefaultsToNotNullColumns( $session );
|
||||
|
||||
finish($session);
|
||||
#-------------------------------------------------------------------------------
|
||||
sub addDefaultsToNotNullColumns {
|
||||
my $session = shift;
|
||||
my $db = $session->db;
|
||||
|
||||
print "\tAdding defaults to not null columns...";
|
||||
|
||||
$db->write('ALTER TABLE `assetAspectMailable` ALTER COLUMN `assetId` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `assetAspectMailable` ALTER COLUMN `revisionDate` SET DEFAULT 0;');
|
||||
$db->write('ALTER TABLE `assetAspectMailable` ALTER COLUMN `mailStyleTemplateId` SET DEFAULT "";');
|
||||
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber` ALTER COLUMN `assetId` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber` ALTER COLUMN `revisionDate` SET DEFAULT 0;');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber` ALTER COLUMN `subscriptionEnabled` SET DEFAULT 0;');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber` ALTER COLUMN `revisionDate` SET DEFAULT 0;');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber` ALTER COLUMN `revisionDate` SET DEFAULT 0;');
|
||||
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber_log` ALTER COLUMN `assetId` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber_log` ALTER COLUMN `requestIp` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber_log` ALTER COLUMN `userId` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber_log` ALTER COLUMN `email` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber_log` ALTER COLUMN `type` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `assetAspectSubscriber_log` ALTER COLUMN `anonymous` SET DEFAULT 0;');
|
||||
|
||||
$db->write('ALTER TABLE `Mailing` ALTER COLUMN `mailingId` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `Mailing` ALTER COLUMN `configuration` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `Mailing` ALTER COLUMN `assetId` SET DEFAULT "";');
|
||||
$db->write('ALTER TABLE `Mailing` ALTER COLUMN `sendDate` SET DEFAULT 0;');
|
||||
$db->write('ALTER TABLE `Mailing` ALTER COLUMN `issueId` SET DEFAULT "";');
|
||||
|
||||
$db->write('ALTER TABLE `Mailing_email` ALTER COLUMN `mailId` SET DEFAULT "";');
|
||||
|
||||
print "Done.\n";
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub addConfirmationTemplateColumn {
|
||||
|
|
@ -108,9 +144,9 @@ sub installMailableAspectTable {
|
|||
|
||||
$session->db->write(<<EOSQL);
|
||||
create table if not exists assetAspectMailable (
|
||||
assetId char(22) binary not null,
|
||||
revisionDate bigint(20) not null,
|
||||
mailStyleTemplateId char(22) binary not null,
|
||||
assetId char(22) binary not null default '',
|
||||
revisionDate bigint(20) not null default 0,
|
||||
mailStyleTemplateId char(22) binary not null default '',
|
||||
primary key( assetId, revisionDate )
|
||||
);
|
||||
EOSQL
|
||||
|
|
@ -125,8 +161,8 @@ sub installSubscriberAspectTable {
|
|||
|
||||
$session->db->write(<<EOSQL);
|
||||
create table if not exists assetAspectSubscriber (
|
||||
assetId char(22) binary not null,
|
||||
revisionDate bigint(20) not null,
|
||||
assetId char(22) binary not null default '',
|
||||
revisionDate bigint(20) not null default 0,
|
||||
subscriptionGroupId char(22) binary,
|
||||
subscriptionEnabled tinyint(1) not null default 0,
|
||||
alwaysConfirmSubscription tinyint(1) not null default 0,
|
||||
|
|
@ -142,16 +178,16 @@ EOSQL
|
|||
|
||||
$session->db->write(<<EOSQL2);
|
||||
create table if not exists assetAspectSubscriber_log (
|
||||
assetId char(22) binary not null,
|
||||
requestIp char(15) not null,
|
||||
requestDate bigint(20) not null,
|
||||
assetId char(22) binary not null default '',
|
||||
requestIp char(15) not null default '',
|
||||
requestDate bigint(20) not null default 0,
|
||||
confirmationIp char(15),
|
||||
confirmationDate bigint(20),
|
||||
userId char(22) binary not null,
|
||||
email varchar(255) not null,
|
||||
type char(30) not null,
|
||||
anonymous tinyint(1) not null,
|
||||
confirmed tinyint(1) default 0,
|
||||
userId char(22) binary not null default '',
|
||||
email varchar(255) not null default '',
|
||||
type char(30) not null default '',
|
||||
anonymous tinyint(1) not null default 0,
|
||||
confirmed tinyint(1) not null default 0,
|
||||
code char(22) default null
|
||||
);
|
||||
EOSQL2
|
||||
|
|
@ -166,9 +202,9 @@ sub installNewsletterCollection {
|
|||
|
||||
$session->db->write(<<EOSQL);
|
||||
create table if not exists NewsletterCollection (
|
||||
assetId char(22) binary not null,
|
||||
revisionDate bigint(20) not null,
|
||||
useHoneypot tinyint(1) default 0,
|
||||
assetId char(22) binary not null default '',
|
||||
revisionDate bigint(20) not null default 0,
|
||||
useHoneypot tinyint(1) not null default 0,
|
||||
primary key( assetId, revisionDate )
|
||||
);
|
||||
EOSQL
|
||||
|
|
@ -331,8 +367,8 @@ sub addSpecialStateTable {
|
|||
|
||||
$session->db->write( <<EOSQL );
|
||||
create table if not exists users_specialState (
|
||||
userId char(22) binary not null,
|
||||
specialState char(30) not null,
|
||||
userId char(22) binary not null default '',
|
||||
specialState char(30) not null default '',
|
||||
primary key ( userId, specialState )
|
||||
)
|
||||
EOSQL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue