glpi-project / telemetry

Telemetry & references for your projects
https://glpi-project.github.io/telemetry/
MIT License
6 stars 2 forks source link

Use phinx #2

Closed trasher closed 7 years ago

trasher commented 7 years ago

I propose to use phinx to handle database installation instead of a SQL script; in order to handle schema changes.

Created database is exactly the same than the old script one (checked using a pg_dump and compare results); with the exception of phinx metadata table.

In order to set up phinx on an existing database, first run ./vendor/bin/sphinx status. This will create the metadata table; and tell you the current status is "down". Once done, run the following query:

INSERT INTO phinxlog
    (version, migration_name, start_time, end_time, breakpoint) 
VALUES
    ('20171006192119', 'Installation', NOW(), NOW(), false)
;

A new run of phinx status, and see it's "up" :)

An INSTALL.md file is provided for fresh installs.

orthagh commented 7 years ago

waiting for rebase before merge

trasher commented 7 years ago

Done, thanks