text: --liquibase formatted sql
  
  --changeset id:1.0.0 author:ssporer
  CREATE SCHEMA IF NOT EXISTS LIBRARY;
  
  --changeset id:1.0.1 author:ssporer
  DROP TABLE IF EXISTS LIBRARY.PERSON;
  CREATE TABLE IF NOT EXISTS LIBRARY.PERSON
  (
    ID INTEGER PRIMARY KEY auto_increment,
    FIRST_NAME NVARCHAR2,
    LAST_NAME NVARCHAR2
  );
  
  --changeset id:1.0.2 author:ssporer
  DROP TABLE IF EXISTS LIBRARY.AUTHOR;
  CREATE TABLE IF NOT EXISTS LIBRARY.AUTHOR
  (
    ID INTEGER PRIMARY KEY auto_increment,
    FIRST_NAME NVARCHAR2,
    LAST_NAME NVARCHAR2
  );
  
  --changeset id:1.0.3 author:ssporer
  DROP TABLE IF EXISTS LIBRARY.BOOK;
  CREATE TABLE IF NOT EXISTS LIBRARY.BOOK
  (
    ID INTEGER PRIMARY KEY auto_increment,
    AUTHOR_ID INTEGER REFERENCES AUTHOR,
    TITLE NVARCHAR2
  );
  
  --changeset id:1.0.4 author:ssporer
  DROP TABLE IF EXISTS LIBRARY.LIBRARIAN;
  CREATE TABLE IF NOT EXISTS LIBRARY.LIBRARIAN
  (
    ID INTEGER PRIMARY KEY auto_increment,
    FIRST_NAME NVARCHAR2,
    LAST_NAME NVARCHAR2
  );
  
  --changeset id:1.0.5 author:ssporer
  DROP TABLE IF EXISTS LIBRARY.CHECKOUT;
  CREATE TABLE IF NOT EXISTS LIBRARY.CHECKOUT
  (
    ID INTEGER PRIMARY KEY auto_increment,
    PERSON_ID INTEGER NOT NULL REFERENCES PERSON,
    BOOK_ID INTEGER NOT NULL REFERENCES BOOK,
    LIBRARIAN_ID INTEGER NOT NULL REFERENCES LIBRARIAN,
    CHECKOUT_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIME,
    CHECKIN_TIME TIMESTAMP,
    USER NVARCHAR2
  );
  
  --changeset id:1.0.6 author:ssporer
  DROP TABLE IF EXISTS LIBRARY.CHECKOUT_HY;
  CREATE TABLE IF NOT EXISTS LIBRARY.CHECKOUT_HY
  (
    ID INTEGER PRIMARY KEY auto_increment,
    PERSON_ID INTEGER NOT NULL REFERENCES PERSON,
    BOOK_ID INTEGER NOT NULL REFERENCES BOOK,
    LIBRARIAN_ID INTEGER NOT NULL REFERENCES LIBRARIAN,
    CHECKOUT_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIME,
    CHECKIN_TIME TIMESTAMP,
    USER NVARCHAR2 NOT NULL DEFAULT CURRENT_USER,
    TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIME,
    ACTION NVARCHAR2
  );
  