changed config table

This commit is contained in:
tracer 2024-04-30 13:11:54 +02:00
parent f25e90f292
commit b06128e819
3 changed files with 105 additions and 4 deletions

View File

@ -2,7 +2,7 @@
"name": "24unix/bindapi", "name": "24unix/bindapi",
"description": "manage Bind9 DNS server via REST API", "description": "manage Bind9 DNS server via REST API",
"version": "1.0.9", "version": "1.0.9",
"build_number": "361", "build_number": "362",
"authors": [ "authors": [
{ {
"name": "Micha Espey", "name": "Micha Espey",

View File

@ -0,0 +1,41 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class UUIDForConfig extends Phinx\Migration\AbstractMigration
{
public function change()
{
$this->table('config', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'DYNAMIC',
])
->addColumn('id', 'uuid', [
'null' => false,
])
->changeColumn('name', 'string', [
'null' => false,
'limit' => 256,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id',
])
->changeColumn('value', 'string', [
'null' => false,
'limit' => 256,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'name',
])
->addIndex(['id'], [
'name' => 'id',
'unique' => true,
])
->save();
}
}

View File

@ -112,12 +112,36 @@ return array (
), ),
'columns' => 'columns' =>
array ( array (
'id' =>
array (
'TABLE_CATALOG' => 'def',
'TABLE_NAME' => 'config',
'COLUMN_NAME' => 'id',
'ORDINAL_POSITION' => 1,
'COLUMN_DEFAULT' => NULL,
'IS_NULLABLE' => 'NO',
'DATA_TYPE' => 'uuid',
'CHARACTER_MAXIMUM_LENGTH' => NULL,
'CHARACTER_OCTET_LENGTH' => NULL,
'NUMERIC_PRECISION' => NULL,
'NUMERIC_SCALE' => NULL,
'DATETIME_PRECISION' => NULL,
'CHARACTER_SET_NAME' => NULL,
'COLLATION_NAME' => NULL,
'COLUMN_TYPE' => 'uuid',
'COLUMN_KEY' => 'PRI',
'EXTRA' => '',
'PRIVILEGES' => 'select,insert,update,references',
'COLUMN_COMMENT' => '',
'IS_GENERATED' => 'NEVER',
'GENERATION_EXPRESSION' => NULL,
),
'name' => 'name' =>
array ( array (
'TABLE_CATALOG' => 'def', 'TABLE_CATALOG' => 'def',
'TABLE_NAME' => 'config', 'TABLE_NAME' => 'config',
'COLUMN_NAME' => 'name', 'COLUMN_NAME' => 'name',
'ORDINAL_POSITION' => 1, 'ORDINAL_POSITION' => 2,
'COLUMN_DEFAULT' => NULL, 'COLUMN_DEFAULT' => NULL,
'IS_NULLABLE' => 'NO', 'IS_NULLABLE' => 'NO',
'DATA_TYPE' => 'varchar', 'DATA_TYPE' => 'varchar',
@ -129,7 +153,7 @@ return array (
'CHARACTER_SET_NAME' => 'utf8mb4', 'CHARACTER_SET_NAME' => 'utf8mb4',
'COLLATION_NAME' => 'utf8mb4_general_ci', 'COLLATION_NAME' => 'utf8mb4_general_ci',
'COLUMN_TYPE' => 'varchar(256)', 'COLUMN_TYPE' => 'varchar(256)',
'COLUMN_KEY' => 'PRI', 'COLUMN_KEY' => 'UNI',
'EXTRA' => '', 'EXTRA' => '',
'PRIVILEGES' => 'select,insert,update,references', 'PRIVILEGES' => 'select,insert,update,references',
'COLUMN_COMMENT' => '', 'COLUMN_COMMENT' => '',
@ -141,7 +165,7 @@ return array (
'TABLE_CATALOG' => 'def', 'TABLE_CATALOG' => 'def',
'TABLE_NAME' => 'config', 'TABLE_NAME' => 'config',
'COLUMN_NAME' => 'value', 'COLUMN_NAME' => 'value',
'ORDINAL_POSITION' => 2, 'ORDINAL_POSITION' => 3,
'COLUMN_DEFAULT' => NULL, 'COLUMN_DEFAULT' => NULL,
'IS_NULLABLE' => 'NO', 'IS_NULLABLE' => 'NO',
'DATA_TYPE' => 'varchar', 'DATA_TYPE' => 'varchar',
@ -163,6 +187,24 @@ return array (
), ),
'indexes' => 'indexes' =>
array ( array (
'PRIMARY' =>
array (
1 =>
array (
'Table' => 'config',
'Non_unique' => 0,
'Key_name' => 'PRIMARY',
'Seq_in_index' => 1,
'Column_name' => 'id',
'Collation' => 'A',
'Sub_part' => NULL,
'Packed' => NULL,
'Null' => '',
'Index_type' => 'BTREE',
'Comment' => '',
'Index_comment' => '',
),
),
'name' => 'name' =>
array ( array (
1 => 1 =>
@ -181,6 +223,24 @@ return array (
'Index_comment' => '', 'Index_comment' => '',
), ),
), ),
'id' =>
array (
1 =>
array (
'Table' => 'config',
'Non_unique' => 0,
'Key_name' => 'id',
'Seq_in_index' => 1,
'Column_name' => 'id',
'Collation' => 'A',
'Sub_part' => NULL,
'Packed' => NULL,
'Null' => '',
'Index_type' => 'BTREE',
'Comment' => '',
'Index_comment' => '',
),
),
), ),
'foreign_keys' => NULL, 'foreign_keys' => NULL,
), ),