diff --git a/appinfo/database.xml b/appinfo/database.xml deleted file mode 100644 index 9c93a9e35..000000000 --- a/appinfo/database.xml +++ /dev/null @@ -1,482 +0,0 @@ - - - *dbname* - true - false - utf8 - - *dbprefix*deck_boards - - - id - integer - 0 - true - 1 - 4 - - - title - text - true - 100 - - - owner - text - true - 64 - - - color - text - 6 - false - - - archived - boolean - false - - - deleted_at - integer - 0 - 8 - false - true - - - last_modified - integer - - false - true - - -
- - *dbprefix*deck_stacks - - - id - integer - 0 - true - 1 - 4 - - - title - text - true - 100 - - - board_id - integer - 8 - true - - - order - integer - 8 - false - - - deleted_at - integer - 0 - 8 - false - true - - - last_modified - integer - - false - true - - - deck_stacks_board_id_index - - board_id - - - - deck_stacks_order_index - - order - - - -
- - *dbprefix*deck_cards - - - id - integer - 0 - true - 1 - 4 - - - title - text - 100 - true - - - description - clob - false - - - description_prev - clob - false - - - stack_id - integer - 8 - true - - - type - text - true - 64 - plain - - - last_modified - integer - - false - true - - - last_editor - text - false - 64 - - - created_at - integer - - false - true - - - owner - text - true - 64 - - - order - integer - 8 - false - - - archived - boolean - false - - - duedate - timestamp - 0 - - - notified - boolean - false - - - deleted_at - integer - 0 - 8 - false - true - - - deck_cards_stack_id_index - - stack_id - - - - deck_cards_order_index - - order - - - - deck_cards_archived_index - - archived - - - -
- - *dbprefix*deck_attachment - - - id - integer - 0 - true - 1 - 4 - - - card_id - integer - 8 - true - - - type - text - true - 64 - - - data - text - - - last_modified - integer - - 8 - false - true - - - created_at - integer - - 8 - false - true - - - created_by - text - true - 64 - - - deleted_at - integer - 0 - 8 - false - true - - -
- - - *dbprefix*deck_labels - - - id - integer - 0 - true - 1 - 4 - - - title - text - false - 100 - - - color - text - 6 - false - - - board_id - integer - true - 8 - - - last_modified - integer - - false - true - - - deck_labels_board_id_index - - board_id - - - -
- - - *dbprefix*deck_assigned_labels - - - id - integer - 0 - true - 1 - 4 - - - label_id - integer - 0 - true - 4 - - - card_id - integer - 0 - true - 4 - - - deck_assigned_labels_idx_i - - label_id - - - - deck_assigned_labels_idx_c - - card_id - - - -
- - *dbprefix*deck_assigned_users - - - id - integer - 0 - true - 1 - 4 - - - participant - text - true - 64 - - - card_id - integer - 0 - true - 4 - - - deck_assigned_users_idx_p - - participant - - - - deck_assigned_users_idx_c - - card_id - - - -
- - *dbprefix*deck_board_acl - - - id - integer - 0 - true - 1 - 4 - - - board_id - integer - true - 8 - - - type - integer - true - 4 - - - participant - text - true - 64 - - - permission_edit - boolean - false - - - permission_share - boolean - false - - - permission_manage - boolean - false - - - deck_board_acl_uq_i - true - - board_id - ascending - - - type - ascending - - - participant - ascending - - - - deck_board_acl_idx_i - - board_id - - - - -
-
diff --git a/lib/Migration/Version1000Date20200306161713.php b/lib/Migration/Version1000Date20200306161713.php new file mode 100644 index 000000000..9094a04cb --- /dev/null +++ b/lib/Migration/Version1000Date20200306161713.php @@ -0,0 +1,327 @@ +hasTable('deck_boards')) { + $table = $schema->createTable('deck_boards'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('title', 'string', [ + 'notnull' => true, + 'length' => 100, + ]); + $table->addColumn('owner', 'string', [ + 'notnull' => true, + 'length' => 64, + ]); + $table->addColumn('color', 'string', [ + 'notnull' => false, + 'length' => 6, + ]); + $table->addColumn('archived', 'boolean', [ + 'notnull' => false, + 'default' => false, + ]); + $table->addColumn('deleted_at', 'bigint', [ + 'notnull' => false, + 'length' => 8, + 'default' => 0, + 'unsigned' => true, + ]); + $table->addColumn('last_modified', 'integer', [ + 'notnull' => false, + 'default' => 0, + 'unsigned' => true, + ]); + $table->setPrimaryKey(['id']); + } + + if (!$schema->hasTable('deck_stacks')) { + $table = $schema->createTable('deck_stacks'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('title', 'string', [ + 'notnull' => true, + 'length' => 100, + ]); + $table->addColumn('board_id', 'bigint', [ + 'notnull' => true, + 'length' => 8, + ]); + $table->addColumn('order', 'bigint', [ + 'notnull' => false, + 'length' => 8, + ]); + $table->addColumn('deleted_at', 'bigint', [ + 'notnull' => false, + 'length' => 8, + 'default' => 0, + 'unsigned' => true, + ]); + $table->addColumn('last_modified', 'integer', [ + 'notnull' => false, + 'default' => 0, + 'unsigned' => true, + ]); + $table->setPrimaryKey(['id']); + $table->addIndex(['board_id'], 'deck_stacks_board_id_index'); + $table->addIndex(['order'], 'deck_stacks_order_index'); + } + + if (!$schema->hasTable('deck_cards')) { + $table = $schema->createTable('deck_cards'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('title', 'string', [ + 'notnull' => true, + 'length' => 100, + ]); + $table->addColumn('description', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('description_prev', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('stack_id', 'bigint', [ + 'notnull' => true, + 'length' => 8, + ]); + $table->addColumn('type', 'string', [ + 'notnull' => true, + 'length' => 64, + 'default' => 'plain', + ]); + $table->addColumn('last_modified', 'integer', [ + 'notnull' => false, + 'default' => 0, + 'unsigned' => true, + ]); + $table->addColumn('last_editor', 'string', [ + 'notnull' => false, + 'length' => 64, + ]); + $table->addColumn('created_at', 'integer', [ + 'notnull' => false, + 'default' => 0, + 'unsigned' => true, + ]); + $table->addColumn('owner', 'string', [ + 'notnull' => true, + 'length' => 64, + ]); + $table->addColumn('order', 'bigint', [ + 'notnull' => false, + 'length' => 8, + ]); + $table->addColumn('archived', 'boolean', [ + 'notnull' => false, + 'default' => false, + ]); + $table->addColumn('duedate', 'datetime', [ + 'notnull' => false, + ]); + $table->addColumn('notified', 'boolean', [ + 'notnull' => false, + 'default' => false, + ]); + $table->addColumn('deleted_at', 'bigint', [ + 'notnull' => false, + 'length' => 8, + 'default' => 0, + 'unsigned' => true, + ]); + $table->setPrimaryKey(['id']); + $table->addIndex(['stack_id'], 'deck_cards_stack_id_index'); + $table->addIndex(['order'], 'deck_cards_order_index'); + $table->addIndex(['archived'], 'deck_cards_archived_index'); + } + + if (!$schema->hasTable('deck_attachment')) { + $table = $schema->createTable('deck_attachment'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('card_id', 'bigint', [ + 'notnull' => true, + 'length' => 8, + ]); + $table->addColumn('type', 'string', [ + 'notnull' => true, + 'length' => 64, + ]); + $table->addColumn('data', 'string', [ + 'notnull' => false, + ]); + $table->addColumn('last_modified', 'bigint', [ + 'notnull' => false, + 'length' => 8, + 'default' => 0, + 'unsigned' => true, + ]); + $table->addColumn('created_at', 'bigint', [ + 'notnull' => false, + 'length' => 8, + 'default' => 0, + 'unsigned' => true, + ]); + $table->addColumn('created_by', 'string', [ + 'notnull' => true, + 'length' => 64, + ]); + $table->addColumn('deleted_at', 'bigint', [ + 'notnull' => false, + 'length' => 8, + 'default' => 0, + 'unsigned' => true, + ]); + $table->setPrimaryKey(['id']); + } + + if (!$schema->hasTable('deck_labels')) { + $table = $schema->createTable('deck_labels'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('title', 'string', [ + 'notnull' => false, + 'length' => 100, + ]); + $table->addColumn('color', 'string', [ + 'notnull' => false, + 'length' => 6, + ]); + $table->addColumn('board_id', 'bigint', [ + 'notnull' => true, + 'length' => 8, + ]); + $table->addColumn('last_modified', 'integer', [ + 'notnull' => false, + 'default' => 0, + 'unsigned' => true, + ]); + $table->setPrimaryKey(['id']); + $table->addIndex(['board_id'], 'deck_labels_board_id_index'); + } + + if (!$schema->hasTable('deck_assigned_labels')) { + $table = $schema->createTable('deck_assigned_labels'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('label_id', 'integer', [ + 'notnull' => true, + 'length' => 4, + 'default' => 0, + ]); + $table->addColumn('card_id', 'integer', [ + 'notnull' => true, + 'length' => 4, + 'default' => 0, + ]); + $table->setPrimaryKey(['id']); + $table->addIndex(['label_id'], 'deck_assigned_labels_idx_i'); + $table->addIndex(['card_id'], 'deck_assigned_labels_idx_c'); + } + + if (!$schema->hasTable('deck_assigned_users')) { + $table = $schema->createTable('deck_assigned_users'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('participant', 'string', [ + 'notnull' => true, + 'length' => 64, + ]); + $table->addColumn('card_id', 'integer', [ + 'notnull' => true, + 'length' => 4, + 'default' => 0, + ]); + $table->setPrimaryKey(['id']); + $table->addIndex(['participant'], 'deck_assigned_users_idx_p'); + $table->addIndex(['card_id'], 'deck_assigned_users_idx_c'); + } + + if (!$schema->hasTable('deck_board_acl')) { + $table = $schema->createTable('deck_board_acl'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('board_id', 'bigint', [ + 'notnull' => true, + 'length' => 8, + ]); + $table->addColumn('type', 'integer', [ + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('participant', 'string', [ + 'notnull' => true, + 'length' => 64, + ]); + $table->addColumn('permission_edit', 'boolean', [ + 'notnull' => false, + 'default' => false, + ]); + $table->addColumn('permission_share', 'boolean', [ + 'notnull' => false, + 'default' => false, + ]); + $table->addColumn('permission_manage', 'boolean', [ + 'notnull' => false, + 'default' => false, + ]); + $table->setPrimaryKey(['id']); + $table->addUniqueIndex(['board_id', 'type', 'participant'], 'deck_board_acl_uq_i'); + $table->addIndex(['board_id'], 'deck_board_acl_idx_i'); + } + return $schema; + } + +}