Skip to content

Commit

Permalink
Cleanup DB
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Dec 12, 2023
1 parent 45041d4 commit ad9ad93
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 18 deletions.
37 changes: 19 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 81 additions & 0 deletions config/Migrations/20231104184637_SandboxCleanup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class SandboxCleanup extends AbstractMigration {

/**
* Up Method.
*
* More information on this method is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
* @return void
*/
public function up(): void {
$this->table('users')
->changeColumn('id', 'integer', [
'autoIncrement' => true,
'default' => null,
'null' => false,
'signed' => false,
])
->update();

$this->table('bitmasked_records')
->changeColumn('id', 'integer', [
'autoIncrement' => true,
'default' => null,
'null' => false,
'signed' => false,
])
->update();
$this->table('events')
->changeColumn('id', 'integer', [
'autoIncrement' => true,
'default' => null,
'null' => false,
'signed' => false,
])
->update();
$this->table('exposed_users')
->changeColumn('id', 'integer', [
'autoIncrement' => true,
'default' => null,
'null' => false,
'signed' => false,
])
->update();
$this->table('sandbox_ratings')
->changeColumn('id', 'integer', [
'autoIncrement' => true,
'default' => null,
'null' => false,
'signed' => false,
])
->changeColumn('user_id', 'integer', [
'default' => null,
'null' => true,
'signed' => false,
])
->update();
$this->table('sandbox_users')
->changeColumn('id', 'integer', [
'autoIncrement' => true,
'default' => null,
'null' => false,
'signed' => false,
])
->update();

/*
$this->table('sandbox_ratings')
->addForeignKey('user_id', 'users', ['id'], ['delete' => 'SET_NULL'])
->update();
*/
}

public function down(): void {
}

}

0 comments on commit ad9ad93

Please sign in to comment.