2018-10-31 11:07:37 +00:00
|
|
|
{
|
2019-09-10 05:46:10 +00:00
|
|
|
//rdbms: server type, postgresql,mysql or sqlite3
|
2019-09-30 13:34:30 +00:00
|
|
|
"rdbms": "postgresql",
|
2019-09-10 05:46:10 +00:00
|
|
|
//filename: sqlite3 db file name
|
2018-12-29 09:17:50 +00:00
|
|
|
//"filename":"",
|
2019-09-10 05:46:10 +00:00
|
|
|
//host: server address,localhost by default;
|
2019-09-30 13:34:30 +00:00
|
|
|
"host": "127.0.0.1",
|
2019-09-10 05:46:10 +00:00
|
|
|
//port: server port, 5432 by default;
|
2019-09-30 13:34:30 +00:00
|
|
|
"port": 5432,
|
2019-09-10 05:46:10 +00:00
|
|
|
//dbname: Database name;
|
2019-09-30 13:34:30 +00:00
|
|
|
"dbname": "",
|
2019-09-10 05:46:10 +00:00
|
|
|
//schema: valid for postgreSQL, "public" by default;
|
2019-10-26 15:44:31 +00:00
|
|
|
"schema": "public",
|
2019-09-30 13:34:30 +00:00
|
|
|
//user: User name
|
|
|
|
"user": "",
|
|
|
|
//password: Password
|
|
|
|
"passwd": "",
|
|
|
|
//table: An array of tables to be modelized. if the array is empty, all revealed tables are modelized.
|
|
|
|
"tables": [],
|
2019-10-26 15:44:31 +00:00
|
|
|
"relationships": {
|
|
|
|
"enabled": false,
|
|
|
|
"items": [{
|
|
|
|
"type": "has one",
|
|
|
|
"original_table_name": "products",
|
|
|
|
"original_table_alias": "product",
|
|
|
|
"original_key": "id",
|
|
|
|
"target_table_name": "skus",
|
|
|
|
"target_table_alias": "SKU",
|
|
|
|
"target_key": "product_id",
|
|
|
|
"enable_reverse": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "has many",
|
|
|
|
"original_table_name": "products",
|
|
|
|
"original_table_alias": "product",
|
|
|
|
"original_key": "id",
|
|
|
|
"target_table_name": "reviews",
|
|
|
|
"target_table_alias": "",
|
|
|
|
"target_key": "product_id",
|
|
|
|
"enable_reverse": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "many to many",
|
|
|
|
"original_table_name": "products",
|
|
|
|
"original_table_alias": "",
|
|
|
|
"original_key": "id",
|
|
|
|
"pivot_table": {
|
|
|
|
"table_name": "carts_products",
|
|
|
|
"original_key": "product_id",
|
|
|
|
"target_key": "cart_id"
|
|
|
|
},
|
|
|
|
"target_table_name": "carts",
|
|
|
|
"target_table_alias": "",
|
|
|
|
"target_key": "id",
|
|
|
|
"enable_reverse": true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-09-30 13:34:30 +00:00
|
|
|
"restful_api_controllers": {
|
|
|
|
"enabled": false,
|
|
|
|
// resource_uri: The URI to access the resource, the default value
|
|
|
|
// is '/*' in which the asterisk represents the table name.
|
|
|
|
// If this option is set to a empty string, the URI is composed of the namespaces and the class name.
|
|
|
|
"resource_uri": "/*",
|
|
|
|
// class_name: "Restful*Ctrl" by default, the asterisk represents the table name.
|
|
|
|
// This option can contain namespaces.
|
|
|
|
"class_name": "Restful*Ctrl",
|
|
|
|
// filters: an array of filter names.
|
|
|
|
"filters": [],
|
|
|
|
// db_client: the database client used by the controller. this option must be consistent with
|
|
|
|
// the configuration of the application.
|
|
|
|
"db_client": {
|
|
|
|
//name: Name of the client,'default' by default
|
|
|
|
"name": "default",
|
|
|
|
//is_fast:
|
|
|
|
"is_fast": false
|
|
|
|
},
|
|
|
|
// directory: The directory where the controller source files are stored.
|
|
|
|
"directory": "controllers",
|
|
|
|
// generate_base_only: false by default. Set to true to avoid overwriting custom subclasses.
|
|
|
|
"generate_base_only": false
|
|
|
|
}
|
|
|
|
}
|