Skip to content

Commit

Permalink
Version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
grosjo committed Jan 3, 2022
1 parent 4efe9db commit b8dc08d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 197 deletions.
193 changes: 0 additions & 193 deletions appinfo/database.xml

This file was deleted.

5 changes: 2 additions & 3 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Tomboy, Conboy and Tomdroid clients are supported.
</description>
<version>1.0.1</version>
<version>1.0.2</version>
<licence>agpl</licence>
<author>Joan Moreau</author>
<namespace>Grauphel</namespace>
Expand All @@ -19,7 +19,6 @@
<repository type="git">https://github.com/grosjo/nextcloud-grauphel.git</repository>
<dependencies>
<lib>OAuth</lib>
<owncloud min-version="7"/>
<nextcloud min-version="13" max-version="22"/>
<nextcloud min-version="22" max-version="23"/>
</dependencies>
</info>
2 changes: 1 addition & 1 deletion appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
62 changes: 62 additions & 0 deletions lib/Migration/Version010002Date20220103070900.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace OCA\Grauphel\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

class Version010002Date20220103070900 extends SimpleMigrationStep
{
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper
{
$schema = $schemaClosure();

if (!$schema->hasTable('grauphel_oauth_tokens'))
{
$table = $schema->createTable('grauphel_oauth_tokens');
$table->addColumn('token_id', 'integer', [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, 'default' => 0 ]);
$table->addColumn('token_user', 'text', [ 'length' => 64, 'notnull' => false ]);
$table->addColumn('token_type', 'text', [ 'length' => 16, 'notnull' => true ]);
$table->addColumn('token_key', 'text', [ 'length' => 128, 'notnull' => true ]);
$table->addColumn('token_secret', 'text', [ 'length' => 128, 'notnull' => true ]);
$table->addColumn('token_verifier', 'text', [ 'length' => 128, 'notnull' => true ]);
$table->addColumn('token_callback', 'text', [ 'length' => 2048, 'notnull' => true ]);
$table->addColumn('token_client', 'text', [ 'length' => 256, 'notnull' => true ]);
$table->addColumn('token_lastuse', 'timestamp', [ 'notnull' => true ]);
$table->setPrimaryKey(['token_id']);
}

if (!$schema->hasTable('grauphel_notes'))
{
$table = $schema->createTable('grauphel_notes');
$table->addColumn('note_id', 'integer', [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, 'default' => 0 ]);
$table->addColumn('note_user', 'text', [ 'length' => 64, 'notnull' => false ]);
$table->addColumn('note_guid', 'text', [ 'length' => 128, 'notnull' => true ]);
$table->addColumn('note_last_sync_revision', 'integer', [ 'notnull' => true, 'length' => 20, 'default' => 0 ]);
$table->addColumn('note_create_date', 'text', [ 'length' => 33, 'notnull' => true ]);
$table->addColumn('note_last_change_date', 'text', [ 'length' => 33, 'notnull' => true ]);
$table->addColumn('note_last_metadata_change_date', 'text', [ 'length' => 33, 'notnull' => true ]);
$table->addColumn('note_title', 'text', [ 'length' => 1024, 'notnull' => true ]);
$table->addColumn('note_content', 'clob', [ 'notnull' => true ]);
$table->addColumn('note_content_version', 'text', [ 'length' => 16, 'notnull' => true ]);
$table->addColumn('note_open_on_startup', 'integer', [ 'length' => 1, 'notnull' => true, 'default' => 0 ]);
$table->addColumn('note_pinned', 'integer', [ 'length' => 1, 'notnull' => true, 'default' => 0 ]);
$table->addColumn('note_tags', 'text', [ 'length' => 1024, 'notnull' => true ]);
$table->setPrimaryKey(['note_id']);
}

if (!$schema->hasTable('grauphel_syncdata'))
{
$table = $schema->createTable('grauphel_syncdata');
$table->addColumn('syncdata_id', 'integer', [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, 'default' => 0 ]);
$table->addColumn('syncdata_user', 'text', [ 'length' => 64, 'notnull' => true ]);
$table->addColumn('syncdata_current_sync_guid', 'text', [ 'length' => 64, 'notnull' => true ]);
$table->addColumn('syncdata_latest_sync_revision', 'integer', [ 'length' => 20, 'notnull' => true, 'default' => 0 ]);
$table->setPrimaryKey(['syncdata_id']);
}

return $schema;
}
}

0 comments on commit b8dc08d

Please sign in to comment.