~ci-train-bot/history-service/history-service-ubuntu-yakkety-landing-1774

« back to all changes in this revision

Viewing changes to plugins/sqlite/schema/update_schema.sh.in

Make it possible to use the custom functions defined by the sqlite plugin in the
schema files themselves.
Approved by: Tiago Salem Herrmann, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
VERSION="1"
12
12
LATEST_VERSION="1"
13
13
 
14
 
TMPFILE=`tempfile`
15
 
 
 
14
SCHEMA_FILES=""
16
15
SCHEMA_FILE="$SOURCE_DIR/v${VERSION}.sql"
17
16
while [ -e $SCHEMA_FILE ]; do
18
 
    cat $SCHEMA_FILE >> $TMPFILE
 
17
    SCHEMA_FILES="$SCHEMA_FILES $SCHEMA_FILE"
19
18
    LATEST_VERSION=$VERSION
20
19
    VERSION=$(($VERSION+1))
21
20
    SCHEMA_FILE="$SOURCE_DIR/v${VERSION}.sql"
22
21
done
23
22
 
24
 
sqlite3 -init $TMPFILE :memory: .schema > $TARGET_FILE
 
23
@CMAKE_CURRENT_BINARY_DIR@/generate_schema $SCHEMA_FILES $TARGET_FILE
25
24
echo $LATEST_VERSION > $VERSION_FILE