Creation of oairecords DB using MYSQL

Overview

mysql> CREATE DATABASE oairecords;
Query OK, 1 row affected (0.15 sec)

mysql> use oairecords;
Database changed

mysql> CREATE TABLE SetMembers
    -> (recordId varchar(50) NOT NULL,
    -> setSpec varchar(100) NOT NULL);
Query OK, 0 rows affected (0.31 sec)

mysql> CREATE TABLE MetadataMembers
    -> (recordId varchar(50) NOT NULL,
    -> format varchar(20) NOT NULL);
Query OK, 0 rows affected (0.31 sec)

mysql> CREATE TABLE Identifiers
    -> (recordId varchar(50) PRIMARY KEY,
    -> dateModified bigint(20) DEFAULT 0,
    -> fileName varchar(255) NOT NULL,
    -> dataType varchar(50) NOT NULL,
    -> configSubDir varchar(255) NOT NULL);
Query OK, 0 rows affected (0.33 sec)

mysql> CREATE TABLE Sets
    -> (setSpec varchar(100) PRIMARY KEY,
    -> setName varchar(255),NOT NULL,
    -> setTag varchar(20) NOT NULL,
    -> setContentSummary varchar(255) DEFAULT NULL);
Query OK, 0 rows affected (0.31 sec)

mysql> CREATE TABLE SupportedTypes
    -> (dataType(varchar(50));
Query OK, 0 rows affected (0.28 sec)

mysql> CREATE TABLE MetadataFormats
    -> (format varchar(20) PRIMARY KEY,
    -> description varchar(255) NOT NULL,
    -> schemaLocation varchar(255) DEFAULT NULL,
    -> required tinyint(1) NOT NULL DEFAULT 0);
Query OK, 0 rows affected (0.39 sec)

mysql> CREATE TABLE LastValue
    -> (lastNumber bigint(20) NOT NULL,
    -> name varchar(10) NOT NULL);
Query OK, 0 rows affected (0.31 sec)

mysql> CREATE TABLE Collections
    -> (name varchar(50) PRIMARY KEY,
    -> description varchar(255) NOT NULL,
    -> dataType varchar(50) NOT NULL,
    -> lastUpdated bigint(20) NOT NULL DEFAULT 0);
Query OK, 0 rows affected (0.34 sec)

Insertion of Starting data

mysql> INSERT INTO LastValue(lastNumber,name)
    -> VALUES(0,"value");
Query OK, 1 row affected (0.11 sec)

mysql> INSERT INTO Sets
    -> VALUES("collection","Collection Set","collection",NULL);
Query OK, 1 row affected (0.05 sec)

mysql> INSERT INTO SupportedTypes(dataType)
    -> VALUES("text");
Query OK, 1 row affected (0.12 sec)

mysql> INSERT INTO SupportedTypes(dataType)
    -> VALUES("xml");
Query OK, 1 row affected (0.05 sec)

mysql> INSERT INTO MetadataFormats(format,description,schemaLocation,required)
    -> VALUES("oai_dc";,"Dublin Core","http://purl.org/dc/elements/1.1/ http://www.openarchives.org/OAI/1.1/dc.xsd",1);
Query OK, 1 row affected (0.12 sec)

mysql> INSERT INTO MetadataFormats
    -> VALUES ("oai_st","SDARTS Protocol", http://www.cs
<.cs.columbia.edu/~dli2test/STARTS/
http://www.cs.columbia.edu/~dli2test/schema/starts.xsd",1);
Query OK, 1 row affected (0.05 sec)

User Creation

mysql> use oairecords;
Database changed

    ->GRANT SELECT ON *
    -> TO harvester@localhost
    -> IDENTIFIED BY 'some_pass';
Query OK, 0 rows affected (0.13 sec)

mysql> GRANT SELECT,INSERT,UPDATE ON *
    -> TO oaiadmin@localhost
    -> IDENTIFIED BY 'some_pass';
Query OK, 0 rows affected (0.11 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.12 sec)