19declare(strict_types=1);
29 protected \ilDBInterface
$db;
38 if ($this->db->tableColumnExists(
'tst_tests',
'mailnotification')) {
39 $this->db->dropTableColumn(
'tst_tests',
'mailnotification');
41 if ($this->db->tableColumnExists(
'tst_tests',
'mailnottype')) {
42 $this->db->dropTableColumn(
'tst_tests',
'mailnottype');
49 if (!$this->db->tableExists(
'tst_test_settings')) {
52 $this->db->createSequence(
'tst_test_settings');
53 $this->db->addPrimaryKey(
'tst_test_settings', [
'id']);
56 foreach (self::SETTINGS_COLUMNS as $key => $value) {
57 [$column_def] = $value;
60 if (!isset($column_def[
'notnull'])) {
64 $this->db->addTableColumn(
'tst_test_settings', $key, $column_def);
69 if (!$this->db->tableColumnExists(
'tst_tests',
'settings_id')) {
70 $this->db->addTableColumn(
75 $this->db->addForeignKey(
81 ForeignKeyConstraints::NO_ACTION,
82 ForeignKeyConstraints::RESTRICT,
87 if (!$this->db->tableColumnExists(
'tst_test_defaults',
'settings_id')) {
88 $this->db->addTableColumn(
93 $this->db->addForeignKey(
99 ForeignKeyConstraints::NO_ACTION,
100 ForeignKeyConstraints::RESTRICT
103 if (!$this->db->tableColumnExists(
'tst_test_defaults',
'description')) {
104 $this->db->addTableColumn(
110 if (!$this->db->tableColumnExists(
'tst_test_defaults',
'author')) {
111 $this->db->addTableColumn(
119 if (!$this->db->tableExists(
'tst_defaults_marks')) {
120 $this->db->createTable(
121 'tst_defaults_marks',
127 $this->db->addPrimaryKey(
'tst_defaults_marks', [
'defaults_id',
'mark_id']);
129 $this->db->addForeignKey(
130 'test_default_fkey2',
132 'tst_defaults_marks',
133 [
'test_defaults_id'],
135 ForeignKeyConstraints::NO_ACTION,
136 ForeignKeyConstraints::RESTRICT
139 $this->db->addForeignKey(
142 'tst_defaults_marks',
145 ForeignKeyConstraints::NO_ACTION,
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
columnIsNullable(array $column_def)