/usr/bin/mysql_install_db: Deprecated program name.
It will be removed in a future release, use 'mariadb-install-db' instead
Change-Id: I09bb289708c513d4ee0a229a6b1f859e064cfea2
The schema files contains '1970-01-01 00:00:01' as the value for timestamp
columns but when the sql file is uploaded into mariadb it's converted
according to time-zone settings and causes '0000-00-00 00:00:00' value
and warning 'Out of range value for column'.
So set session time zone UTC.
Change-Id: I6e5634df12104e2887142ace77df574c4200179c
Fix of db-schema.git:29ce6639d6a5101bf008274b678f022a449ca8e0 commit.
Instead of using string '1970-01-01 00:00:00' use
FROM_UNIXTIME(1).
Using the string causes the date '0000-00-00 00:00:00' and the warning:
+---------+------+-----------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------+
| Warning | 1264 | Out of range value for column 'applied_at' at row 1 |
+---------+------+-----------------------------------------------------+
It's because the time zones differences so '1970-01-01 00:00:00'
translates into earlier date which is out of range for timestamp
datatype.
Using the FROM_UNIXTIME() gives us a reliable result which fits the
datatype and is not zero date.
Change-Id: Ie123363a74e81c37c8ca5458b6aafd53fd3b74ca
This reverts commit 29ce6639d6.
Reason: setting timestamp fields as '0000-00-00 00:00:00' causes
API v1 ORM to read them as undefined and breaks the related logic as
either create_timestamp or modify_timestamp are expected to be
valid datetime strings.
Change-Id: I48ac4daa2e63727b6aa16314d9427ba4833937aa
Update columns with default 'current_timestamp()' to zero unixtime.
Update encrypted password and hashes to the current value,
Change-Id: I177d0f51437678526b0ae84fa916dafaa1dbf0ec
The jenkins uses DB_BASE variable which is path to db.git repo. So if
this variable is set - we need to use db_scripts from this path.
Change-Id: If7af8a38890f7d5da95effeb4bec2b0c7e2ab920
With current set of options (which are quite similar to the ones in
/etc/mysql/my.cnf) db script db_scripts/diff/15787.up renames the index
name of voip_preferences_enum.preference_id to pref_id_fk.
So to fix this problem and prevent any further ones - copy existing
/etc/mysql/my.cnf and modify it for dedicated instance.
Change-Id: I9311c12d0d3f0bf0e5a28a40790dd6908a92f32a
It was initially added to reduce the diff on a review but now we
automatically merge generated schemes.
So no need to do such substitution besides it's dangerous to do such
manipulation on sql file.
Change-Id: I1e78ebe85e731f6be2f84afdf53c3befbb8d55ef
Instead of using the script which is installed - use the one from
review. If it's missing for some reason - try installed one.
So you can see if there is any problem with build tools when you create a
review not after you merged it.
Change-Id: I9725db44f94c77099bdc9e50db41596fb2f29061
The DDL statements should be as precise as possible so don't change
anything there.
In data part we need to replace dates (which are different on every
build) with some value, so use NOW() function.
Change-Id: Ia731f2f6836de2d2770cfd148e402cc83db6182e
To speed up loading of the dump we use 'autocommit=0' in the header of
sql dump. So add final 'commit'.
Change-Id: Iaf8dd6dde16d64a288460e00e47605b029b5d0c2
For sql dump we need to setup some variable like FOREIGN_KEY_CHECKS=0,
or NAMES utf8 as well as 'CREATE DATABASE' statement. And we do but then
it's wiped due to incorrect redirection '>' instead of '>>'. So fix it.
Change-Id: Id37153d5e4ac038f788c34443e1bb5715d5e3985
This parameter was changed in templates.git:279d3ce for mysql servers so
change build instance accordingly.
Change-Id: Ie69adea67066c582c9887b8b7ab2c683b6ca24b5
The main tool ngcp-build-schema-files:
1. initializes and starts a dedicated mysql instance in tmpfs.
2. prepares schemes.
3. runs ngcp-dump-json.pl and mysqldump to get sql and json files.
4. stops and deletes mysql instance.
The helper ngcp-dump-json.pl creates json dump of the schema.
Change-Id: I65968d0f9136b619f9adc5ed735daca0bd129e6e