diff --git a/appinfo/database.xml b/appinfo/database.xml deleted file mode 100644 index e9f1c29..0000000 --- a/appinfo/database.xml +++ /dev/null @@ -1,207 +0,0 @@ - - *dbname* - true - false - utf8 - - *dbprefix*quicknotes_notes - - - id - integer - true - true - true - true - 8 - - - user_id - text - 200 - - true - - - title - text - 200 - - true - - - content - clob - - true - - - timestamp - integer - 0 - true - 4 - - - color_id - integer - true - 8 - - -
- - *dbprefix*quicknotes_colors - - - id - integer - true - true - true - true - 8 - - - color - text - - -
- - *dbprefix*quicknotes_tags - - - id - integer - true - true - true - true - 8 - - - user_id - text - 200 - - true - - - name - text - 200 - - true - - -
- - *dbprefix*quicknotes_note_tags - - - id - integer - true - true - true - true - 8 - - - user_id - text - 200 - - true - - - note_id - integer - true - true - 8 - - - tag_id - integer - true - true - 8 - - -
- - *dbprefix*quicknotes_tasks - - - id - integer - true - true - true - true - 8 - - - note_id - integer - true - true - 8 - - - description - text - 200 - - true - - - done - boolean - false - true - - - ordering - integer - 0 - true - - -
- - *dbprefix*quicknotes_shares - - - id - integer - true - true - true - true - 8 - - - note_id - integer - true - true - 8 - - - shared_user - text - 200 - - - - shared_group - text - 200 - - - -
-
diff --git a/controller/errors.php b/lib/Controller/Errors.php similarity index 100% rename from controller/errors.php rename to lib/Controller/Errors.php diff --git a/controller/notecontroller.php b/lib/Controller/NoteController.php similarity index 100% rename from controller/notecontroller.php rename to lib/Controller/NoteController.php diff --git a/controller/pagecontroller.php b/lib/Controller/PageController.php similarity index 100% rename from controller/pagecontroller.php rename to lib/Controller/PageController.php diff --git a/controller/tagcontroller.php b/lib/Controller/TagController.php similarity index 100% rename from controller/tagcontroller.php rename to lib/Controller/TagController.php diff --git a/db/color.php b/lib/Db/Color.php similarity index 100% rename from db/color.php rename to lib/Db/Color.php diff --git a/db/colormapper.php b/lib/Db/ColorMapper.php similarity index 100% rename from db/colormapper.php rename to lib/Db/ColorMapper.php diff --git a/db/note.php b/lib/Db/Note.php similarity index 100% rename from db/note.php rename to lib/Db/Note.php diff --git a/db/notemapper.php b/lib/Db/NoteMapper.php similarity index 100% rename from db/notemapper.php rename to lib/Db/NoteMapper.php diff --git a/db/noteshare.php b/lib/Db/NoteShare.php similarity index 100% rename from db/noteshare.php rename to lib/Db/NoteShare.php diff --git a/db/notesharemapper.php b/lib/Db/NoteShareMapper.php similarity index 100% rename from db/notesharemapper.php rename to lib/Db/NoteShareMapper.php diff --git a/db/notetag.php b/lib/Db/NoteTag.php similarity index 100% rename from db/notetag.php rename to lib/Db/NoteTag.php diff --git a/db/notetagmapper.php b/lib/Db/NoteTagMapper.php similarity index 100% rename from db/notetagmapper.php rename to lib/Db/NoteTagMapper.php diff --git a/db/tag.php b/lib/Db/Tag.php similarity index 100% rename from db/tag.php rename to lib/Db/Tag.php diff --git a/db/tagmapper.php b/lib/Db/TagMapper.php similarity index 100% rename from db/tagmapper.php rename to lib/Db/TagMapper.php diff --git a/db/task.php b/lib/Db/Task.php similarity index 100% rename from db/task.php rename to lib/Db/Task.php diff --git a/db/taskmapper.php b/lib/Db/TaskMapper.php similarity index 100% rename from db/taskmapper.php rename to lib/Db/TaskMapper.php diff --git a/lib/Migration/Version000204Date20200530211356.php b/lib/Migration/Version000204Date20200530211356.php new file mode 100644 index 0000000..d229f4e --- /dev/null +++ b/lib/Migration/Version000204Date20200530211356.php @@ -0,0 +1,192 @@ +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) { + } +} diff --git a/service/notfoundexception.php b/lib/Service/NotFoundException.php similarity index 100% rename from service/notfoundexception.php rename to lib/Service/NotFoundException.php diff --git a/service/noteservice.php b/lib/Service/NoteService.php similarity index 100% rename from service/noteservice.php rename to lib/Service/NoteService.php diff --git a/service/serviceexception.php b/lib/Service/ServiceException.php similarity index 100% rename from service/serviceexception.php rename to lib/Service/ServiceException.php