#40 adding created_at and update_at timestamps to subscribers and settings
This commit is contained in:
@@ -44,6 +44,8 @@ class Migrator {
|
||||
'first_name tinytext NOT NULL,',
|
||||
'last_name tinytext NOT NULL,',
|
||||
'email varchar(150) NOT NULL,',
|
||||
'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
|
||||
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
|
||||
'PRIMARY KEY (id),',
|
||||
'UNIQUE KEY email (email)'
|
||||
);
|
||||
@@ -55,6 +57,8 @@ class Migrator {
|
||||
'id mediumint(9) NOT NULL AUTO_INCREMENT,',
|
||||
'name varchar(20) NOT NULL,',
|
||||
'value varchar(255) NOT NULL,',
|
||||
'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
|
||||
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
|
||||
'PRIMARY KEY (id),',
|
||||
'UNIQUE KEY name (name)'
|
||||
);
|
||||
@@ -67,7 +71,7 @@ class Migrator {
|
||||
$sql = array();
|
||||
$sql[] = "CREATE TABLE " . $table . " (";
|
||||
$sql = array_merge($sql, $attributes);
|
||||
$sql[] = ")" . $this->charset . ";";
|
||||
$sql[] = ") " . $this->charset . ";";
|
||||
|
||||
return implode("\n", $sql);
|
||||
}
|
||||
|
Reference in New Issue
Block a user