Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add bootstrap script, sql sample data

  • Loading branch information...
commit 8a4a0890c9da7dac5c4a057c724bc2461ca9a391 1 parent f75c1c2
@rgm authored
View
3  README.md
@@ -12,5 +12,6 @@ Starting out:
# create sample database and set it up as an ODBC datasource
$ script/bootstrap
- # hit menu Tools > Database > Manage Databases... in Vectorworks
+ # Fire up Vectorworks and connect through 'Tools > Database > Manage
+ # Databases...'
View
13 odbc.ini
@@ -0,0 +1,13 @@
+[ODBC Data Sources]
+mysql-vw-test = mysql-odbc-connector
+
+[mysql-vw-test]
+Driver = mysql-odbc-connector
+Database = WHOAMI
+Server = localhost
+Uid = root
+Socket = /tmp/mysql.sock
+
+[ODBC]
+;Trace = yes
+;TraceFile = PWD/odbctrace.log
View
6 odbcinst.ini
@@ -0,0 +1,6 @@
+[ODBC Drivers]
+mysql-odbc-connector = installed
+
+[mysql-odbc-connector]
+Description = MySQL driver for Mac OS X
+Driver = /usr/local/lib/libmyodbc5.so
View
5 script/add_sample_data
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+DBNAME=$(whoami)
+echo " + adding sample data to database '$DBNAME'"
+mysql -u root $DBNAME < sheets.sql
View
6 script/bootstrap
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+script/make_db
+script/add_sample_data
+script/copy_odbc_config
View
24 script/copy_odbc_config
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+DBNAME=$(whoami)
+PWD=$(pwd)
+DST=~/Library/ODBC
+ODBC=odbc.ini
+ODBCINST=odbcinst.ini
+echo " + copying ODBC config files to ~/Library/ODBC"
+if [ -f "$DST/$ODBC" ]
+then
+ echo " x Error: '$DST/$ODBC' exists; either move or delete it"
+ exit 1
+fi
+if [ -f "$DST/$ODBCINST" ]
+then
+ echo " x Error: '$DST/$ODBCINST' exists; either move or delete it"
+ exit 1
+fi
+if [ ! -d "$DST" ]
+then
+ mkdir "$DST"
+fi
+cat $ODBC | sed "s/WHOAMI/$DBNAME/g;s:PWD:${PWD}:g" > "$DST/$ODBC"
+cp odbcinst.ini "$DST"
View
5 script/make_db
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+DBNAME=$(whoami)
+echo " + making MySQL database '$DBNAME'"
+mysqladmin -u root create $DBNAME
View
16 sheets.sql
@@ -0,0 +1,16 @@
+SET NAMES utf8;
+SET FOREIGN_KEY_CHECKS = 0;
+
+DROP TABLE IF EXISTS `sheets`;
+CREATE TABLE `sheets` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `sheet_number` varchar(15) DEFAULT NULL,
+ `sheet_name` varchar(31) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
+
+BEGIN;
+INSERT INTO `sheets` VALUES ('1', 'A101', 'L1 Plan'), ('2', 'A401', 'L1 Reflected Ceiling Plan'), ('3', 'A102', 'L2 Plan'), ('4', 'A201', 'Sections'), ('5', 'A301', 'Elevations');
+COMMIT;
+
+SET FOREIGN_KEY_CHECKS = 1;
Please sign in to comment.
Something went wrong with that request. Please try again.