Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbtk/schema-loader
Database schema loader
https://github.com/dbtk/schema-loader
Last synced: 2 months ago
JSON representation
Database schema loader
- Host: GitHub
- URL: https://github.com/dbtk/schema-loader
- Owner: dbtk
- License: mit
- Created: 2015-05-30T05:59:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-18T14:28:04.000Z (almost 5 years ago)
- Last Synced: 2024-11-11T10:32:33.972Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 63.5 KB
- Stars: 5
- Watchers: 5
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- php-awesome - schema-loader - Load database schema from an XML file (类库 / 数据库)
README
schema-loader
=============Load database schema from an XML file.
## Usage
You can load schema to database by:
### Database url
A full URL containing username, password, hostname and dbname:
```
./bin/dbtk-schema-loader schema:load example/schema.xml mysql://username:password@localhost/dbname
```### Just a dbname
In this case [linkorb/database-manager](https://github.com/linkorb/database-manager) is used for loading database connection details (server, username, password, etc) from .conf files (read project readme for more details).
In a nutshell - you must have a `dbname.conf` file at `/share/config/database/` as described at [database-manager's documentation](https://github.com/linkorb/database-manager#database-configuration-files).
```bash
./bin/dbtk-schema-loader schema:load example/schema.xml dbname
```### Examples
See `example/schema.xml` or `/tests/fixtures/schema.xml`.
### Notices
- Don't forget to use `notnull="false"` for optional fields.
- Don't use `primaryKey="id"` in table definition - in version `~2.0` indexes have new format.## License
Please refer to the included LICENSE file## Brought to you by the LinkORB Engineering team
Check out our other projects at [engineering.linkorb.com](http://engineering.linkorb.com).Btw, we're hiring!