mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-17 12:58:39 +00:00
add todos and improve db schema
This commit is contained in:
parent
1b70ddce75
commit
401ca50d2c
|
|
@ -340,43 +340,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"country": {
|
||||
"name": "country",
|
||||
"fields": {
|
||||
"country_id": {
|
||||
"name": "country_id",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"country_name": {
|
||||
"name": "country_name",
|
||||
"type": "VARCHAR(100)",
|
||||
"null": false
|
||||
},
|
||||
"country_native": {
|
||||
"name": "country_native",
|
||||
"type": "VARCHAR(100)",
|
||||
"null": false
|
||||
},
|
||||
"country_code2": {
|
||||
"name": "country_code2",
|
||||
"type": "VARCHAR(2)",
|
||||
"null": false
|
||||
},
|
||||
"country_code3": {
|
||||
"name": "country_code3",
|
||||
"type": "VARCHAR(3)",
|
||||
"null": false
|
||||
},
|
||||
"country_codenum": {
|
||||
"name": "country_codenum",
|
||||
"type": "INT(11)",
|
||||
"null": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"account": {
|
||||
"name": "account",
|
||||
"fields": {
|
||||
|
|
@ -568,36 +531,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"account_settings": {
|
||||
"name": "account_settings",
|
||||
"fields": {
|
||||
"account_settings_id": {
|
||||
"name": "account_settings_id",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"account_settings_name": {
|
||||
"name": "account_settings_name",
|
||||
"type": "VARCHAR(30)",
|
||||
"null": false,
|
||||
"unique": true
|
||||
},
|
||||
"account_settings_content": {
|
||||
"name": "account_settings_content",
|
||||
"type": "VARCHAR(250)",
|
||||
"null": false
|
||||
},
|
||||
"account_settings_account": {
|
||||
"name": "account_settings_account",
|
||||
"type": "INT",
|
||||
"null": false,
|
||||
"foreignTable": "account",
|
||||
"foreignKey": "account_id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"name": "settings",
|
||||
"fields": {
|
||||
|
|
@ -635,6 +568,14 @@
|
|||
"null": true,
|
||||
"foreignTable": "group",
|
||||
"foreignKey": "group_id"
|
||||
},
|
||||
"settings_account": {
|
||||
"name": "settings_account",
|
||||
"type": "INT",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "account",
|
||||
"foreignKey": "account_id"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ namespace Modules\Admin\Admin;
|
|||
use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
|
||||
use phpOMS\Module\InfoManager;
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
|
||||
|
|
@ -43,47 +44,11 @@ final class Installer extends InstallerAbstract
|
|||
'database' => __DIR__ . '/../../../phpOMS/Localization/Defaults/localization.sqlite'
|
||||
]);
|
||||
|
||||
self::installCountries($sqlite, $dbPool);
|
||||
self::installLanguages($sqlite, $dbPool);
|
||||
|
||||
$sqlite->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Install countries
|
||||
*
|
||||
* @param SQLiteConnection $sqlite SQLLite database connection of the source data
|
||||
* @param DatabasePool $dbPool Database pool to save data to
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function installCountries(SQLiteConnection $sqlite, DatabasePool $dbPool) : void
|
||||
{
|
||||
$con = $dbPool->get();
|
||||
|
||||
$query = new Builder($con);
|
||||
$query->prefix($con->getPrefix())
|
||||
->insert('country_name', 'country_native', 'country_code2', 'country_code3', 'country_codenum')
|
||||
->into('country');
|
||||
|
||||
$querySqlite = new Builder($sqlite);
|
||||
$countries = $querySqlite->select('*')->from('country')->execute();
|
||||
|
||||
foreach ($countries as $country) {
|
||||
$query->values(
|
||||
$country['country_name'],
|
||||
$country['country_name'],
|
||||
$country['country_code2'],
|
||||
$country['country_code3'],
|
||||
$country['country_numeric']
|
||||
);
|
||||
}
|
||||
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Install languages
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
<th data-name="city">City
|
||||
<th data-name="zip">Zip
|
||||
<th data-name="country">Country
|
||||
<!-- todo: get data from tr in action and pass it to next actions, or make new request based on table cell? -->
|
||||
<tbody data-action='[
|
||||
{
|
||||
"key": 1, "listener": "click", "selector": "#acc-table tbody tr", "action": [
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user