Sunday, May 11, 2014

Installing Liquibase 3.1.1 on Centos 6.5

This is my idiot guide to installing Liquibase 3.1.1 on a Centos 6.5 box. I've done this several times in the past but keep forgetting how to do it, so I'm documenting the steps I followed for future reference.

Install Java

Liquibase 3.x requires Java 1.6+ so lets get that installed first

$ sudo yum install java-1.7.0-openjdk

Get the Liquibase Code

I'm just going to install put Liquibase in the home directory for now

$ wget http://sourceforge.net/projects/liquibase/files/Liquibase%20Core/liquibase-3.1.1-bin.tar.gz/download
$ tar zxvf liquibase-3.1.1-bin.tar.gz
$ sudo chmod + x ./liquibase
$ ./liquibase --version

Install Mysql

$ sudo yum install mysql mysql-server
$ sudo chkconfig --levels 235 mysqld on
$ sudo service mysqld start
$ /usr/bin/mysqladmin -u root password 'root'
$ mysql -uroot -proot

Install the Mysql Connector for Java

$ wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.30.tar.gz
$ tar zxvf mysql-connector-java-5.1.30.tar.gz

Create the database

$ mysql -uroot -proot
mysql> create database example;
mysql> exit;

Create a Changelog file

$ vim ./changelog.xml

Add the following...

 <?xml version="1.0" encoding="UTF-8"?>  
 <databaseChangeLog  
   xmlns="http://www.liquibase.org/xml/ns/dbchangelog"  
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">  
   <changeSet id="1" author="bob">  
     <createTable tableName="department">  
       <column name="id" type="int">  
         <constraints primaryKey="true" nullable="false"/>  
       </column>  
       <column name="name" type="varchar(50)">  
         <constraints nullable="false"/>  
       </column>  
       <column name="active" type="boolean" defaultValueBoolean="true"/>  
     </createTable>  
   </changeSet>  
 </databaseChangeLog>  

Run Liquibase

$ ./liquibase --driver=com.mysql.jdbc.Driver --classpath=mysql-connector-java-5.1.30/mysql-connector-java-5.1.30-bin.jar  --changeLogFile=changelog.xml --url="jdbc:mysql://localhost/example" --username=root --password=root update

Create a liquibase.properties file

$ vim ~/liquibase.properties

Add the following...

 driver: com.mysql.jdbc.Driver  
 classpath: mysql-connector-java-5.1.30/mysql-connector-java-5.1.30-bin.jar  
 url: jdbc:mysql://localhost/example  
 username: root  
 password: root  

Run Liquibase... with the properties file
$ ./liquibase --changeLogFile=changelog.xml update

Sunday, March 23, 2014

My Current Reading List

My house is full of books; it's actually something that I'm really pleased with as I never took the activity of reading that seriously as a teen or later as a student.

I'm really pleased that reading is so influential in my family, and reading my daughter a story every night at bed time since not long after she was born has, I hope, has instilled in her how fantastically liberating reading can be.
Recently she has been fascinated by dinosaurs and was happily reading a fairly text heaving book on the subject this morning.

One of the drawbacks though, of being a reading household, it that there are piles of books everywhere, still waiting to be read. I have about 20 science fiction books by the side of my bed, pleading with me to be read each night before I go to bed. In this respect, Laura is much more obliging to read through the pile of books that adorn her bedside table.

So, since I haven't blogged in such a long time - I thought I would share my current reading list.
Actually, I have 2 reading lists; the one that contains books that I actually read or have read and the list that contains those books, that I will probably not read until I am an old man with more time on his hands.

So I will list My Current Reading List of books. I consider that any book that has been in my bag and I have read on the train to work and back in the last couple of months  deserves to be on this list.

This is not some kind of ultimate reading list, that would be a pointless list as books can influence in different ways at different times, so any reference to some kid of high ideal such as ultimate would only be temporal. For example, a book I read today may mean nothing to me, but perhaps the same book would mean much more to me in few years time.

Anyway, here is my current reading list...

Domain Driven Design - Tackling Complexity in the heart of Software by Eric Evans

Affectionately known as the 'Blue Book'; the insight that Eric Evans shares about developing application solutions using domain driven design techniques really opened my eyes to thinking about the code I was writing. When I bought this book, I read it from cover to cover; I'm now reading it for a third time and still learn so much from it.

Implementing Domain-Driven Design by Vaughan Vernon

To go with the 'Blue Book', this is know as the 'Red Book'. This book is fairly new to me; so I'm still only part way through. Vaughan Vernon, regularly refers back to the 'Blue Book' to explain how some of the topics covered can be implemented. 

Design Patterns - Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides

Simply, if you are asked "Do you have this book?" and you answer "No", then your next action had better be to purchase this book. Known as the "Gang of Four" book, this covers the design patterns that any serious developer should be aware of.

The Art of Agile Development by James Shore and Shane Warden

Practicing Agile is something thats fairly new to me; I must admit that I'm not that successful with it at the moment, but I'm keen to learn. This book is fairly heavy going, and I don't think it really that practical unless you are in a position to implement or try to Agile practices.


I love "Martin Fowler Signature Books", I have quite a collection, and this is one book that although covers a fairly particular area of application design, it one that I get a lot from. Web services, both the creation and consumption is something that really interests me.

The Lean Startup by Eric Ries

I'm onto my second read of this book, I would say that it's a fundamental read if you want to learn about the product after software. This book covers many influential ideas such as how to get the most from the MVP (minimal viable product), the Build-Measure-Learn cycle and how it can be used to develop the right product.

David