- Migrated from https://github.com/Yetangitu/owncloud-apps
- substantial bit rot accrued in 4 years of non-maintenance which made Reader unusable - Reader now works reliably on public pages - or at least it _Works For Me™_ - Refactored a substantial part of the code to comply to the "current" (ha ha) Nextcloud API - Dropped Owncloud compatibility for lack of a testing installation - Dropped IE (<11) support - Dropped compatibility with older (<20) Nextcloud versions - Dropped app-specific ajax code, now handled by SettingsController - Updated dependencies where applicable
This commit is contained in:
parent
16afbe45fe
commit
b190e180ef
137 changed files with 30984 additions and 2 deletions
143
lib/Migration/Version013000Date202209191710407.php
Normal file
143
lib/Migration/Version013000Date202209191710407.php
Normal file
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Files_Reader\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
/**
|
||||
* Auto-generated migration step
|
||||
*/
|
||||
class Version013000Date202209191710407 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('reader_bookmarks')) {
|
||||
$table = $schema->createTable('reader_bookmarks');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
// user ID, maps bookmark to NC/OC user
|
||||
$table->addColumn('user_id', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 64,
|
||||
'default' => '',
|
||||
]);
|
||||
// file ID, maps to NC/OC file ID
|
||||
$table->addColumn('file_id', 'bigint', [
|
||||
'notnull' => true,
|
||||
'length' => 11,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
// type (bookmark, annotation, etc)
|
||||
$table->addColumn('type', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 32,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('name', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 512,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('value', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 512,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('content', 'string', [
|
||||
'notnull' => false,
|
||||
'length' => 4096,
|
||||
]);
|
||||
$table->addColumn('last_modified', 'bigint', [
|
||||
'notnull' => false,
|
||||
'length' => 8,
|
||||
'default' => 0,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addIndex(['file_id'], 'reader_bookmarks_file_id_index');
|
||||
$table->addIndex(['user_id'], 'reader_bookmarks_user_id_index');
|
||||
$table->addIndex(['name'], 'reader_bookmarks_name_index');
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('reader_prefs')) {
|
||||
$table = $schema->createTable('reader_prefs');
|
||||
$table->addColumn('id', 'bigint', [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 8,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
// user ID, maps preference to NC/OC user
|
||||
$table->addColumn('user_id', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 64,
|
||||
'default' => '',
|
||||
]);
|
||||
// file ID, maps to NC/OC file ID
|
||||
$table->addColumn('file_id', 'bigint', [
|
||||
'notnull' => true,
|
||||
'length' => 11,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('scope', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 32,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('name', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 128,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('value', 'string', [
|
||||
'notnull' => true,
|
||||
'length' => 4096,
|
||||
'default' => '',
|
||||
]);
|
||||
$table->addColumn('last_modified', 'bigint', [
|
||||
'notnull' => false,
|
||||
'length' => 8,
|
||||
'default' => 0,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addIndex(['file_id'], 'reader_prefs_file_id_index');
|
||||
$table->addIndex(['user_id'], 'reader_prefs_user_id_index');
|
||||
$table->addIndex(['scope'], 'reader_prefs_scope_index');
|
||||
}
|
||||
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) {
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue