mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
Upgrade to some new nextcloud standards
This commit is contained in:
@@ -1,207 +0,0 @@
|
||||
<database>
|
||||
<name>*dbname*</name>
|
||||
<create>true</create>
|
||||
<overwrite>false</overwrite>
|
||||
<charset>utf8</charset>
|
||||
<table>
|
||||
<name>*dbprefix*quicknotes_notes</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>true</autoincrement>
|
||||
<unsigned>true</unsigned>
|
||||
<primary>true</primary>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>user_id</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>title</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>content</name>
|
||||
<type>clob</type>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>timestamp</name>
|
||||
<type>integer</type>
|
||||
<default>0</default>
|
||||
<notnull>true</notnull>
|
||||
<length>4</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>color_id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<length>8</length>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*quicknotes_colors</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>true</autoincrement>
|
||||
<unsigned>true</unsigned>
|
||||
<primary>true</primary>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>color</name>
|
||||
<type>text</type>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*quicknotes_tags</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>true</autoincrement>
|
||||
<unsigned>true</unsigned>
|
||||
<primary>true</primary>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>user_id</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>name</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*quicknotes_note_tags</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>true</autoincrement>
|
||||
<unsigned>true</unsigned>
|
||||
<primary>true</primary>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>user_id</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>note_id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<unsigned>true</unsigned>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>tag_id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<unsigned>true</unsigned>
|
||||
<length>8</length>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*quicknotes_tasks</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>true</autoincrement>
|
||||
<unsigned>true</unsigned>
|
||||
<primary>true</primary>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>note_id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<unsigned>true</unsigned>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>description</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>done</name>
|
||||
<type>boolean</type>
|
||||
<default>false</default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
<field>
|
||||
<name>ordering</name>
|
||||
<type>integer</type>
|
||||
<default>0</default>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*quicknotes_shares</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>true</autoincrement>
|
||||
<unsigned>true</unsigned>
|
||||
<primary>true</primary>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>note_id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<unsigned>true</unsigned>
|
||||
<length>8</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>shared_user</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
</field>
|
||||
<field>
|
||||
<name>shared_group</name>
|
||||
<type>text</type>
|
||||
<length>200</length>
|
||||
<default></default>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
</database>
|
||||
192
lib/Migration/Version000204Date20200530211356.php
Normal file
192
lib/Migration/Version000204Date20200530211356.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\QuickNotes\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
/**
|
||||
* Auto-generated migration step: Please modify to your needs!
|
||||
*/
|
||||
class Version000204Date20200530211356 extends SimpleMigrationStep {
|
||||
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
*/
|
||||
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
* @return null|ISchemaWrapper
|
||||
*/
|
||||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
||||
/** @var ISchemaWrapper $schema */
|
||||
$schema = $schemaClosure();
|
||||
|
||||
if (!$schema->hasTable('quicknotes_notes')) {
|
||||
$table = $schema->createTable('quicknotes_notes');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('user_id', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 200,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('title', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 200,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('content', 'text', [
|
||||
'notnull' => true,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('timestamp', 'integer', [
|
||||
'notnull' => true,
|
||||
'length' => 4,
|
||||
'default' => 0,
|
||||
]);
|
||||
$table->addColumn('color_id', 'bigint', [
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('quicknotes_colors')) {
|
||||
$table = $schema->createTable('quicknotes_colors');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('color', 'string', [
|
||||
'notnull' => false,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('quicknotes_tags')) {
|
||||
$table = $schema->createTable('quicknotes_tags');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('user_id', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 200,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('name', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 200,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('quicknotes_note_tags')) {
|
||||
$table = $schema->createTable('quicknotes_note_tags');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('user_id', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 200,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('note_id', 'bigint', [
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('tag_id', 'bigint', [
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('quicknotes_tasks')) {
|
||||
$table = $schema->createTable('quicknotes_tasks');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('note_id', 'bigint', [
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('description', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 200,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('done', 'boolean', [
|
||||
'notnull' => true,
|
||||
'default' => false,
|
||||
]);
|
||||
$table->addColumn('ordering', 'integer', [
|
||||
'notnull' => true,
|
||||
'default' => 0,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('quicknotes_shares')) {
|
||||
$table = $schema->createTable('quicknotes_shares');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('note_id', 'bigint', [
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('shared_user', 'string', [
|
||||
'notnull' => false,
|
||||
'length' => 200,
|
||||
]);
|
||||
$table->addColumn('shared_group', 'string', [
|
||||
'notnull' => false,
|
||||
'length' => 200,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
}
|
||||
return $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
*/
|
||||
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user