3.1. Database
Upsilon uses the MySQL database. Put it in a container, install it natively, or however you like! There is lots of documentation on the web about how to setup a MySQL Database.
Once it is installed, we need to set a upsilon
database and import the
schema, and initial data.
3.1.1. If you are running on a Linux machine (without containers);
Make sure the upsilon-database-sql
package is installed.
user@host: yum install upsilon-database-sql
Go into the database setup directory, and setup some environment variables;
root@host: cd /usr/share/upsilon-database-sql/ root@host: export UP_DATABASE_USER=myuser root@host: export UP_DATABASE_PASS=mypassword root@host: export UP_DATABASE_HOST=localhost
Note
|
Currently the database name must be upsilon .
|
root@host: mysql -u $UP_DATABASE_USER -p $UP_DATABASE_PASS -e 'CREATE DATABASE upsilon' -h $UP_DATABASE_HOST
3.1.2. Run the database migrations
The updb
program can now populate the initial database.
user@host: ./updb
You will get output something like this;
INFO[0000] conf: {Database:{User:myuser Pass:mypassword Host:localhost Name:upsilon} IsLoaded:true Force:0} INFO[0000] db: mysql://upsilon:upsilon@tcp(upsilon)/upsilon INFO[0000] Migrations directory: /home/xconspirisist/sandbox/upsilon-database-sql/mysql/migrations ...etc...
The database should now be ready to use. Note that the updb
tool is used
during upgrades too.