Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2022-02-01 13:24:17 +0300
committerdartcafe <github@dartcafe.de>2022-02-01 13:24:17 +0300
commitfcf9e80cf974e7d1946c92613438e67520032b39 (patch)
treedb109f8e31453a46c1e8ecb26a0109e047e872ed /lib
parent23367c08ad58360961437520ea8e640afe6b26a2 (diff)
migration fixes
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Migration/TableSchema.php81
1 files changed, 23 insertions, 58 deletions
diff --git a/lib/Migration/TableSchema.php b/lib/Migration/TableSchema.php
index 9f15e25b..b9359f2f 100644
--- a/lib/Migration/TableSchema.php
+++ b/lib/Migration/TableSchema.php
@@ -40,9 +40,7 @@ use OCA\Polls\Db\Watch;
/**
* Database definition for installing and migrations
- *
* These definitions contain the base database layout
- *
* used for initial migration to version 3.x from all prior versoins
*/
@@ -107,74 +105,41 @@ abstract class TableSchema {
];
/**
- * define obsolete tables, which do get migrated as an array of table names
+ * define obsolete tables to drop
*/
public const GONE_TABLES = [
- 'polls_events',
- 'polls_dts',
- 'polls_txts',
- 'polls_particip',
- 'polls_particip_text',
- 'polls_test',
+ 'polls_events', // dropped in 1.0
+ 'polls_dts', // dropped in 0.9
+ 'polls_txts', // dropped in 0.9
+ 'polls_particip', // dropped in 0.9
+ 'polls_particip_text', // dropped in 0.9
+ 'polls_test', // invalid table, accidentially introduced in an old beta version
];
- /** define obsolete columns, which do get migrated
- * Format:
- * public const GONE_COLUMNS = [
- * 'tableName1' => [
- * 'columnName1',
- * 'columnName2',
- * ...,
- * ],
- * 'tableName2' => [
- * 'columnName1',
- * 'columnName2',
- * ...,
- * ],
- * ...,
- * ];
+ /**
+ * define obsolete columns to drop
*/
public const GONE_COLUMNS = [
Poll::TABLE => [
- 'full_anonymous',
- 'options',
- 'settings',
+ 'full_anonymous', // dropped in 3.0, orphaned
+ 'options', // dropped in 3.0, orphaned
+ 'settings', // dropped in 3.0, orphaned
],
Comment::TABLE => [
- 'dt',
+ 'dt', // dropped in 3.0, orphaned
+ ],
+ Share::TABLE => [
+ 'user', // dropped in 1.01
+ 'user_email', // dropped in 1.06 and migrated to email_address
+ ],
+ Log::TABLE => [
+ 'message', // dropped in 1.07, orphaned
],
];
/**
- * define primary keys (only set on table creation)
- * Format:
- * public const PRIMARYKEY = [
- * Poll::TABLE => [
- * 'id' => [
- * 'type' => Types::INTEGER,
- * 'options' => ['autoincrement' => true, 'notnull' => true]
- * ],
- * 'type' => [
- * 'type' => Types::STRING,
- * 'options' => ['notnull' => true, 'default' => 'datePoll', 'length' => 64]],
- * ],
- * ...,
- * ],
- * Option::TABLE => [
- * 'id' => [
- * 'type' => Types::INTEGER,
- * 'options' => ['autoincrement' => true, 'notnull' => true]
- * ],
- * 'poll_id' => [
- * 'type' => Types::INTEGER,
- * 'options' => ['notnull' => true, 'default' => 0]
- * ],
- * ...,
- * ],
- * ...,
- * ];
+ * define table structure
*/
-
public const TABLES = [
Poll::TABLE => [
'id' => ['type' => Types::INTEGER, 'options' => ['autoincrement' => true, 'notnull' => true]],
@@ -268,8 +233,8 @@ abstract class TableSchema {
];
/**
- * Iterate over tables and make sure, the are created or updated
- * according to the schema
+ * Iterate over tables and make sure, they are created or updated
+ * according to the currently valid schema
*/
public static function createOrUpdateSchema(ISchemaWrapper &$schema, IOutput &$output): void {
foreach (self::TABLES as $tableName => $columns) {