Skip to content

Commit

Permalink
Fix init-mysql.sh according to new schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
piernov authored and uniuuu committed Oct 20, 2023
1 parent 3f8fd13 commit ef3eef7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docker/db/init-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ echo "CREATE DATABASE zotero_www" | $MYSQL
# Load in master schema
$MYSQL zotero_master < master.sql
$MYSQL zotero_master < coredata.sql
$MYSQL zotero_master < events.sql

# Set up shard info
echo "INSERT INTO shardHosts VALUES (1, 'mysql', 3306, 'up');" | $MYSQL zotero_master
echo "INSERT INTO shards VALUES (1, 1, 'zotero_shard_1', 'up', '1');" | $MYSQL zotero_master
echo "INSERT INTO shards VALUES (2, 1, 'zotero_shard_2', 'up', '1');" | $MYSQL zotero_master

# Create first group & user
echo "INSERT INTO libraries VALUES (1, 'user', '0000-00-00 00:00:00', 0, 1)" | $MYSQL zotero_master
echo "INSERT INTO libraries VALUES (2, 'group', '0000-00-00 00:00:00', 0, 2)" | $MYSQL zotero_master
echo "INSERT INTO libraries VALUES (1, 'user', 0, 1)" | $MYSQL zotero_master
echo "INSERT INTO libraries VALUES (2, 'group', 0, 2)" | $MYSQL zotero_master
echo "INSERT INTO users VALUES (1, 1, 'admin')" | $MYSQL zotero_master
echo "INSERT INTO groups VALUES (1, 2, 'Shared', 'shared', 'Private', 'members', 'all', 'members', '', '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1)" | $MYSQL zotero_master
echo "INSERT INTO \`groups\` VALUES (1, 2, 'Shared', 'shared', 'Private', 'members', 'all', 'members', '', '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1)" | $MYSQL zotero_master
echo "INSERT INTO groupUsers VALUES (1, 1, 'owner', '0000-00-00 00:00:00', '0000-00-00 00:00:00')" | $MYSQL zotero_master

# Load in www schema
Expand Down

0 comments on commit ef3eef7

Please sign in to comment.