You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Copy the data from path to external_path and remove the path column
23
24
$this->addSql('UPDATE attachments SET external_path=path');
@@ -32,52 +33,10 @@ public function mySQLUp(Schema $schema): void
32
33
$this->addSql('UPDATE attachments SET external_path=NULL WHERE internal_path IS NOT NULL');
33
34
}
34
35
35
-
publicfunctionmySQLDown(Schema$schema): void
36
+
publicfunctiondown(Schema$schema): void
36
37
{
37
38
$this->addSql('UPDATE attachments SET external_path=internal_path WHERE internal_path IS NOT NULL');
38
39
$this->addSql('ALTER TABLE attachments DROP internal_path');
39
40
$this->addSql('ALTER TABLE attachments RENAME COLUMN external_path TO path');
40
41
}
41
-
42
-
publicfunctionpostgreSQLUp(Schema$schema): void
43
-
{
44
-
//We can use the same SQL for PostgreSQL as for MySQL
45
-
$this->mySQLUp($schema);
46
-
}
47
-
48
-
publicfunctionpostgreSQLDown(Schema$schema): void
49
-
{
50
-
//We can use the same SQL for PostgreSQL as for MySQL
51
-
$this->mySQLDown($schema);
52
-
}
53
-
54
-
publicfunctionsqLiteUp(Schema$schema): void
55
-
{
56
-
$this->addSql('CREATE TEMPORARY TABLE __temp__attachments AS SELECT id, type_id, original_filename, show_in_table, name, last_modified, datetime_added, class_name, element_id, path FROM attachments');
57
-
$this->addSql('DROP TABLE attachments');
58
-
$this->addSql('CREATE TABLE attachments (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, type_id INTEGER NOT NULL, original_filename VARCHAR(255) DEFAULT NULL, show_in_table BOOLEAN NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, class_name VARCHAR(255) NOT NULL, element_id INTEGER NOT NULL, internal_path VARCHAR(255) DEFAULT NULL, external_path VARCHAR(255) DEFAULT NULL, CONSTRAINT FK_47C4FAD6C54C8C93 FOREIGN KEY (type_id) REFERENCES attachment_types (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE)');
0 commit comments