Issues (4057)

Branch: main

src/Surfnet/Migrations/Version20160620153812.php (10 issues)

1
<?php
2
3
/**
4
 * Copyright 2016 SURFnet bv
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
0 ignored issues
show
Missing @link tag in file comment
Loading history...
18
19
namespace Surfnet\Migrations;
20
21
use Doctrine\DBAL\Schema\Schema;
22
use Doctrine\Migrations\AbstractMigration;
23
24
/**
25
 * Auto-generated Migration: Please modify to your needs!
26
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
27
class Version20160620153812 extends AbstractMigration
28
{
29
    /**
30
     * @param Schema $schema
31
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
32
    public function up(Schema $schema): void
33
    {
34
        // this up() migration is auto-generated, please modify it to your needs
35
        $this->abortIf(
36
            $this->connection->getDatabasePlatform()->getName() != 'mysql',
0 ignored issues
show
Deprecated Code introduced by
The function Doctrine\DBAL\Platforms\...ractPlatform::getName() has been deprecated: Identify platforms by their class. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

36
            /** @scrutinizer ignore-deprecated */ $this->connection->getDatabasePlatform()->getName() != 'mysql',

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
37
            'Migration can only be executed safely on \'mysql\'.',
38
        );
39
40
        $this->addSql('ALTER TABLE ra_location DROP PRIMARY KEY');
41
        $this->addSql(
42
            'ALTER TABLE ra_location ADD name VARCHAR(255) NOT NULL, DROP ra_location_name, CHANGE institution institution VARCHAR(255) NOT NULL, CHANGE location location LONGTEXT NOT NULL, CHANGE contact_information contact_information LONGTEXT NOT NULL, CHANGE ra_location_id id VARCHAR(36) NOT NULL',
43
        );
44
        $this->addSql('ALTER TABLE ra_location ADD PRIMARY KEY (id)');
45
        $this->addSql(
46
            'ALTER TABLE audit_log CHANGE actor_institution actor_institution VARCHAR(255) DEFAULT NULL, CHANGE identity_institution identity_institution VARCHAR(255) NOT NULL, CHANGE recorded_on recorded_on DATETIME NOT NULL, CHANGE actor_common_name actor_common_name VARCHAR(255) DEFAULT NULL',
47
        );
48
        $this->addSql(
49
            'ALTER TABLE identity CHANGE name_id name_id VARCHAR(255) NOT NULL, CHANGE institution institution VARCHAR(255) NOT NULL, CHANGE email email VARCHAR(255) NOT NULL, CHANGE common_name common_name VARCHAR(255) NOT NULL, CHANGE preferred_locale preferred_locale VARCHAR(255) NOT NULL',
50
        );
51
        $this->addSql('ALTER TABLE institution_listing CHANGE institution institution VARCHAR(255) NOT NULL');
52
        $this->addSql(
53
            'ALTER TABLE ra_candidate CHANGE institution institution VARCHAR(255) NOT NULL, CHANGE common_name common_name VARCHAR(255) NOT NULL, CHANGE email email VARCHAR(255) NOT NULL, CHANGE name_id name_id VARCHAR(255) NOT NULL',
54
        );
55
        $this->addSql(
56
            'ALTER TABLE ra_listing CHANGE institution institution VARCHAR(255) NOT NULL, CHANGE common_name common_name VARCHAR(255) NOT NULL, CHANGE email email VARCHAR(255) NOT NULL, CHANGE role role VARCHAR(20) NOT NULL, CHANGE location location LONGTEXT DEFAULT NULL, CHANGE contact_information contact_information LONGTEXT DEFAULT NULL',
57
        );
58
        $this->addSql(
59
            'ALTER TABLE ra_second_factor CHANGE institution institution VARCHAR(255) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE email email VARCHAR(255) NOT NULL, CHANGE status status INT NOT NULL, CHANGE document_number document_number VARCHAR(255) NOT NULL',
60
        );
61
        $this->addSql(
62
            'ALTER TABLE second_factor_revocation CHANGE institution institution VARCHAR(255) NOT NULL, CHANGE recorded_on recorded_on DATETIME NOT NULL',
63
        );
64
        $this->addSql('ALTER TABLE sraa CHANGE name_id name_id VARCHAR(200) NOT NULL');
65
        $this->addSql('ALTER TABLE whitelist_entry CHANGE institution institution VARCHAR(255) NOT NULL');
66
    }
67
68
    /**
69
     * @param Schema $schema
70
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
71
    public function down(Schema $schema): void
72
    {
73
        // this down() migration is auto-generated, please modify it to your needs
74
        $this->abortIf(
75
            $this->connection->getDatabasePlatform()->getName() != 'mysql',
0 ignored issues
show
Deprecated Code introduced by
The function Doctrine\DBAL\Platforms\...ractPlatform::getName() has been deprecated: Identify platforms by their class. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

75
            /** @scrutinizer ignore-deprecated */ $this->connection->getDatabasePlatform()->getName() != 'mysql',

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
76
            'Migration can only be executed safely on \'mysql\'.',
77
        );
78
79
        $this->addSql(
80
            'ALTER TABLE audit_log CHANGE actor_common_name actor_common_name VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE actor_institution actor_institution VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE identity_institution identity_institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE recorded_on recorded_on DATETIME NOT NULL',
81
        );
82
        $this->addSql(
83
            'ALTER TABLE identity CHANGE name_id name_id VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE common_name common_name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE email email VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE preferred_locale preferred_locale VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci',
84
        );
85
        $this->addSql(
86
            'ALTER TABLE institution_listing CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci',
87
        );
88
        $this->addSql(
89
            'ALTER TABLE ra_candidate CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE name_id name_id VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE common_name common_name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE email email VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci',
90
        );
91
        $this->addSql(
92
            'ALTER TABLE ra_listing CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE common_name common_name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE email email VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE role role VARCHAR(20) NOT NULL COLLATE utf8_unicode_ci, CHANGE location location LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE contact_information contact_information LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci',
93
        );
94
        $this->addSql('ALTER TABLE ra_location DROP PRIMARY KEY');
95
        $this->addSql(
96
            'ALTER TABLE ra_location ADD ra_location_name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, DROP name, CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE location location LONGTEXT NOT NULL COLLATE utf8_unicode_ci, CHANGE contact_information contact_information LONGTEXT NOT NULL COLLATE utf8_unicode_ci, CHANGE id ra_location_id VARCHAR(36) NOT NULL COLLATE utf8_unicode_ci',
97
        );
98
        $this->addSql('ALTER TABLE ra_location ADD PRIMARY KEY (ra_location_id)');
99
        $this->addSql(
100
            'ALTER TABLE ra_second_factor CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE name name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE email email VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE document_number document_number VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE status status INT NOT NULL',
101
        );
102
        $this->addSql(
103
            'ALTER TABLE second_factor_revocation CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE recorded_on recorded_on DATETIME NOT NULL',
104
        );
105
        $this->addSql('ALTER TABLE sraa CHANGE name_id name_id VARCHAR(200) NOT NULL COLLATE utf8_unicode_ci');
106
        $this->addSql(
107
            'ALTER TABLE whitelist_entry CHANGE institution institution VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci',
108
        );
109
    }
110
}
111