diff --git a/appinfo/database.xml b/appinfo/database.xml deleted file mode 100644 index 33c2458..0000000 --- a/appinfo/database.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - *dbname* - true - false - utf8 - - *dbprefix*weather_city - - - id - integer - true - 10 - 1 - true - - - name - text - true - 255 - - - user_id - text - true - 255 - - -
- - *dbprefix*weather_config - - - user - text - true - 255 - - - key - text - true - 255 - - - value - text - false - 10240 - - -
-
diff --git a/lib/Migration/Version010703Date20201101235744.php b/lib/Migration/Version010703Date20201101235744.php new file mode 100644 index 0000000..d225ed4 --- /dev/null +++ b/lib/Migration/Version010703Date20201101235744.php @@ -0,0 +1,78 @@ +hasTable('weather_city')) { + $table = $schema->createTable('weather_city'); + $table->addColumn('id', 'bigint', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 10, + ]); + $table->addColumn('name', 'string', [ + 'notnull' => true, + 'length' => 255, + ]); + $table->addColumn('user_id', 'string', [ + 'notnull' => true, + 'length' => 255, + ]); + $table->setPrimaryKey(['id']); + } + + if (!$schema->hasTable('weather_config')) { + $table = $schema->createTable('weather_config'); + $table->addColumn('user', 'string', [ + 'notnull' => true, + 'length' => 255, + ]); + $table->addColumn('key', 'string', [ + 'notnull' => true, + 'length' => 255, + ]); + $table->addColumn('value', 'string', [ + 'notnull' => false, + 'length' => 10240, + ]); + } + 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) { + } +}