Attempt to fix repeated sql issue we come across (#7123)

* Attempt to fix repeated sql issue we come across

* renamed sql file
This commit is contained in:
Neil Lathwood
2017-08-14 22:00:41 +01:00
committed by GitHub
parent dc41c9d565
commit 7b97e0e761
2 changed files with 3 additions and 21 deletions

View File

@@ -1,21 +0,0 @@
#!/bin/bash
GH_REPO="@github.com/librenms/librenms.git"
FULL_REPO="https://${GH_TOKEN}:x-oauth-basic$GH_REPO"
DBTEST=1 ./scripts/build-schema.php
STATUS=$(git status -s misc/db_schema.yaml)
if [[ "$STATUS" != "" ]]; then
mkdir -p _schema
cd _schema
git init
git remote add origin $FULL_REPO
git fetch
git config user.name "lnms-docs"
git config user.email "travis@librenms.org"
git checkout master
cp ../misc/db_schema.yaml misc/db_schema.yaml
git commit -a -m "DB Schema updated by travis after $TRAVIS_COMMIT"
git push -q origin master
fi

3
sql-schema/204.sql Normal file
View File

@@ -0,0 +1,3 @@
ALTER TABLE `dbSchema` DROP PRIMARY KEY;
ALTER TABLE `dbSchema` ADD PRIMARY KEY (`version`);
ALTER TABLE `dbSchema` CHANGE `version` `version` int(11) NOT NULL DEFAULT '0';