Is there a minimum version requirement for using postgresql with drone? I’m attempting to use postgresql 9.2.23 with drone 0.8.4, and getting this error:
ERRO[0000] pq: syntax error at or near "NOT"
FATA[0000] migration failed
I’m aware that 9.2 is end of life upstream, but it is still supported by Red Hat in RHEL 7 until 2024, so I would like to use it if possible.
I believe 9.6 is the minimum, which is the version we run our unit tests against. Drone takes advantage of at least two syntax features that are only available in more recent versions:
-
IF NOT EXISTS
for creating indexes in our migration script
-
INSERT IGNORE
for synchronizing data
The latter is core to how Drone works, so unfortunately there is no easy way to fallback to older versions of postgres without this capability.
Thanks for that clarification. Postgresql 9.6 is doable on RHEL 7, either via https://yum.postgresql.org or Red Hat’s rh-postgresql96 software collection. My main motivation for using the default 9.2 was the longer support lifecycle.
Is there a minimum version of mysql/mariadb required? RHEL 7 ships mariadb 5.5.56, and I may just use that instead. In fact, I guess the overall ask here is can the minimum database versions required be added to the documentation? I’m happy to send a pull request for this if you let me know the versions.
I am not sure the exact minimum version, unfortunately, but we use mysql 5.6.27 for our unit tests. It could work with older versions as well.
If you are open to running the unit tests against older mysql versions to determine the minimum required version, and updating the docs, it would definitely be appreciated. You can run the mysql tests in isolation with the following command:
export DATABASE_DRIVER=mysql
export DATABASE_CONFIG=root@tcp(localhost:3306)/test?parseTime=true
go test github.com/drone/drone/store/datastore
Based on the unit tests, it appears RHEL 6’s mysql 5.1 and RHEL 7’s mariadb 5.5 are sufficient.
[root@el6 ~]# rpm -q mysql-server
mysql-server-5.1.73-8.el6_8.x86_64
[root@test6 ~]# go test github.com/drone/drone/store/datastore
ok github.com/drone/drone/store/datastore 0.933s
[root@el7 ~]# rpm -q mariadb-server
mariadb-server-5.5.56-2.el7.x86_64
[root@el7 ~]# go test github.com/drone/drone/store/datastore
ok github.com/drone/drone/store/datastore 1.063s
I also ran the tests with various postgresql versions. 9.2 and 9.4 failed with the same error as I originally posted. 9.5 did pass however. Would you consider a pull request that adds more pipeline steps (and corresponding services) to drone’s .drone.yml
to test multiple versions of mysql/mariadb and postgresql? I think it may be prudent to just have the database config docs point to the .drone.yml
file for compatible database versions, rather than having docs get out of sync with reality.