2013-10-24 13:14:52 -05:00
|
|
|
<?php if(!defined('APPLICATION')) exit();
|
2013-10-24 15:19:32 -05:00
|
|
|
/* Copyright 2013 Zachary Doll */
|
2013-10-24 13:14:52 -05:00
|
|
|
|
2013-10-24 15:19:32 -05:00
|
|
|
if(!isset($Drop)) {
|
2013-10-24 13:14:52 -05:00
|
|
|
$Drop = FALSE; // Safe default - Set to TRUE to drop the table if it already exists.
|
2013-10-24 15:19:32 -05:00
|
|
|
}
|
2013-10-24 13:14:52 -05:00
|
|
|
|
2013-10-24 15:19:32 -05:00
|
|
|
if(!isset($Explicit)) {
|
2013-10-24 13:14:52 -05:00
|
|
|
$Explicit = FALSE; // Safe default - Set to TRUE to remove all other columns from table.
|
2013-10-24 15:19:32 -05:00
|
|
|
}
|
2013-10-24 13:14:52 -05:00
|
|
|
|
|
|
|
$Database = Gdn::Database();
|
2013-10-25 17:05:01 -05:00
|
|
|
//$SQL = $Database->SQL(); // To run queries.
|
2013-10-24 13:14:52 -05:00
|
|
|
$Construct = $Database->Structure(); // To modify and add database tables.
|
2013-10-25 17:05:01 -05:00
|
|
|
//$Validation = new Gdn_Validation(); // To validate permissions (if necessary).
|
2013-10-24 13:14:52 -05:00
|
|
|
|
2013-10-24 15:19:32 -05:00
|
|
|
$Construct->Table('Reaction')
|
|
|
|
->PrimaryKey('ReactionID')
|
|
|
|
->Column('InsertUserID', 'int', FALSE, 'index.1')
|
|
|
|
->Column('ActionID', 'int', FALSE, 'index')
|
|
|
|
->Column('ParentID', 'int', TRUE)
|
|
|
|
->Column('ParentType', array('discussion', 'comment', 'activity'), TRUE)
|
2013-10-25 17:05:01 -05:00
|
|
|
->Column('ParentAuthorID', 'int', FALSE)
|
2013-10-24 15:19:32 -05:00
|
|
|
->Column('DateInserted', 'datetime')
|
|
|
|
->Set($Explicit, $Drop);
|
2013-10-24 13:14:52 -05:00
|
|
|
|
2013-10-24 15:19:32 -05:00
|
|
|
$Construct->Table('Action')
|
|
|
|
->PrimaryKey('ActionID')
|
|
|
|
->Column('Name', 'varchar(140)')
|
|
|
|
->Column('Description', 'varchar(255)')
|
|
|
|
->Column('Tooltip', 'varchar(255)')
|
2013-10-28 15:03:05 -05:00
|
|
|
->Column('CssClass', 'varchar(255)')
|
2013-10-24 15:19:32 -05:00
|
|
|
->Column('AwardValue', 'int', 1)
|
|
|
|
->Set($Explicit, $Drop);
|
|
|
|
|
|
|
|
$Construct->Table('Badge')
|
|
|
|
->PrimaryKey('BadgeID')
|
|
|
|
->Column('Name', 'varchar(140)')
|
2013-11-01 16:14:14 -05:00
|
|
|
->Column('Description', 'varchar(255)', NULL)
|
|
|
|
->Column('Photo', 'varchar(255)', NULL)
|
|
|
|
->Column('RuleClass', 'varchar(255)')
|
|
|
|
->Column('RuleCriteria', 'text', TRUE)
|
|
|
|
->Column('AwardValue', 'int', 0)
|
|
|
|
->Column('Enabled', 'tinyint(1)', '1')
|
2013-10-24 15:19:32 -05:00
|
|
|
->Set($Explicit, $Drop);
|
2013-11-04 17:32:04 -06:00
|
|
|
|
|
|
|
$Construct->Table('BadgeAward')
|
|
|
|
->PrimaryKey('BadgeAwardID')
|
|
|
|
->Column('BadgeID', 'int')
|
|
|
|
->Column('UserID', 'int')
|
|
|
|
->Column('DateInserted', 'datetime')
|
|
|
|
->Set($Explicit, $Drop);
|