-#!/bin/bash
+#!/usr/bin/env bash
#-------------------------------------------------------------------------------
## Script to convert the database of paraslash 0.2.x to version 0.3.x.
# How to connect to para_server 0.2.x.
client02=/usr/local/bin/para_client
-port02=2990
+port02=2991
host02=localhost
# How to connect to para_server 0.3.x.
convert_attributes()
{
local att atts current_atts cmd query="select dir.dir, dir.name"
- exec_client02_cmd laa name dir
+ exec_client02_cmd laa
atts="$result"
for att in $atts; do
query="$query, data.$att"
command is one of the following:
- attrbibute_table: create attributes
- attrbibutes: convert attributes for each audio file
+ attribute_table: create attributes
+ attributes: convert attributes for each audio file
lastplayed_numplayed: convert numplayed and lastplayed
data of each audio file
image_table: retrieve images from mysql and add them to the database
fi
case "$1" in
-attrbibute_table)
+attribute_table)
convert_attribute_table
;;
-attrbibutes)
+attributes)
convert_attributes
;;
lastplayed_numplayed)
convert_lastplayed_numplayed
convert_image_table
convert_image_ids
+ ;;
*)
usage
exit 1