#!/usr/local/bin/perl

# NOTE: FOR TABLES THAT CONFIGURE A SERIAL NUMBER (ALL THREE)
# EDIT THE config_*.sql TO ADD THE LAST ROW NO. BY HAND!

$command = "psql -d play -U alice";

# run the mcm_test table insertion:
$what = "mcm_test";
#`$command -f create_$what.sql -o create_$what.out 2>create_$what.err`;   # creates the table
`$command -f insert_$what.sql -o insert_$what.out 2>insert_$what.err`;   # inserts first batch of values
`$command -f config_$what.sql -o config_$what.out 2>config_$what.err`;   # configures serial no.
#`$command -f insert_${what}2.sql -o insert_${what}2.out 2>insert_${what}2.err`; # inserts second batch - serial no. not filled!

psql -d play -U alice -f insert_values.sql -o insert_values.out 2>insert_values.err

# run the wafer_test table insertion:
#$what = "wafer_test";
#`$command -f create_$what.sql -o create_$what.out 2>create_$what.err`;   # creates the table
#`$command -f insert_$what.sql -o insert_$what.out 2>insert_$what.err`;   # inserts the values
#`$command -f config_$what.sql -o config_$what.out 2>config_$what.err`;   # configures serial no.

# run the ori_test table insertion:
#$what = "ori_test";
#`$command -f create_$what.sql -o create_$what.out 2>create_$what.err`;   # creates the table
#`$command -f insert_$what.sql -o insert_$what.out 2>insert_$what.err`;   # inserts the values
#`$command -f config_$what.sql -o config_$what.out 2>config_$what.err`;   # configures serial no.
