mirror of
https://github.com/slawkens/myaac.git
synced 2026-04-23 10:53:32 +02:00
Merge branch 'develop' into feature/2fa
This commit is contained in:
11
system/migrations/50-gallery.sql
Normal file
11
system/migrations/50-gallery.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE IF NOT EXISTS `myaac_gallery`
|
||||
(
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`comment` varchar(255) NOT NULL DEFAULT '',
|
||||
`image` varchar(255) NOT NULL,
|
||||
`thumb` varchar(255) NOT NULL,
|
||||
`author` varchar(50) NOT NULL DEFAULT '',
|
||||
`ordering` int NOT NULL DEFAULT 0,
|
||||
`hide` tinyint NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8mb4;
|
||||
@@ -1,36 +1,16 @@
|
||||
<?php
|
||||
// 2fa
|
||||
// add the myaac_account_email_codes
|
||||
|
||||
/**
|
||||
* @var OTS_DB_MySQL $db
|
||||
*/
|
||||
|
||||
$up = function () use ($db) {
|
||||
if (!$db->hasColumn('accounts', '2fa_type')) {
|
||||
$db->addColumn('accounts', '2fa_type', "tinyint NOT NULL DEFAULT 0 AFTER `web_flags`");
|
||||
}
|
||||
|
||||
if (!$db->hasColumn('accounts', '2fa_secret')) {
|
||||
$db->addColumn('accounts', '2fa_secret', "varchar(16) NOT NULL DEFAULT '' AFTER `2fa_type`");
|
||||
}
|
||||
|
||||
// add myaac_account_email_codes table
|
||||
if (!$db->hasTable(TABLE_PREFIX . 'account_email_codes')) {
|
||||
$db->exec(file_get_contents(__DIR__ . '/46-account_email_codes.sql'));
|
||||
if ($db->hasTable(TABLE_PREFIX . 'gallery')) {
|
||||
$db->dropTable(TABLE_PREFIX . 'gallery');
|
||||
}
|
||||
};
|
||||
|
||||
$down = function () use ($db) {
|
||||
if ($db->hasColumn('accounts', '2fa_type')) {
|
||||
$db->dropColumn('accounts', '2fa_type');
|
||||
}
|
||||
|
||||
if ($db->hasColumn('accounts', '2fa_secret')) {
|
||||
$db->dropColumn('accounts', '2fa_secret');
|
||||
}
|
||||
|
||||
if ($db->hasTable(TABLE_PREFIX . 'account_email_codes')) {
|
||||
$db->dropTable(TABLE_PREFIX . 'account_email_codes');
|
||||
if (!$db->hasTable(TABLE_PREFIX . 'gallery')) {
|
||||
$db->query(file_get_contents(__DIR__ . '/50-gallery.sql'));
|
||||
}
|
||||
};
|
||||
|
||||
1
system/migrations/51.php
Normal file
1
system/migrations/51.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
Reference in New Issue
Block a user