Skip to content
Tapper team edited this page Mar 10, 2016 · 4 revisions

How to tweak the "create table" statements when creating a new database

Overview

  1. dump create table statements as the OR mapper would use them
  2. modify them to your needs
  3. execute that modified SQL against your database
  4. initialize Tapper but skip its table creation

Step 0 - Preparations

You should have installed all Tapper modules, e.g., by following the HelloWorld instructions.

Step 1 - Dumping create statements

mkdir -p /tmp/my-tweaked-tapper-tables
cd /tmp/my-tweaked-tapper-tables
perl -Ilib -MTapper::Schema::TestrunDB -MTapper::Model=model -e 'model->create_ddl_dir([qw/MySQL SQLite/], undef, "./")'

Step 2 - Modify the create statements

vi Tapper-Schema-TestrunDB-4.001043-MySQL.sql
# patch manually whatever you consider important

Step 3 - Create DB using the modified SQL

  $ mysql -u root -p
  $ mysql> drop database testrundb;
  $ mysql> create database if not exists testrundb CHARACTER SET utf8 COLLATE utf8_general_ci;
    mysql> grant all on `testrundb`.* to `tapper`@localhost identified by 'verysecret';
    mysql> quit;

TO BE CONTINUED...

Quick Links

About

Release changelogs

  • 5.0 2016-03 "Max Headroom"
  • 4.1 2012-10 "Cagney&Lacey"
  • 4.0 2012-05 "Columbo"
  • 3.0 2011-03 - public release
  • 2.0 2008-12 "Lastwagenkrieg"
  • 1.0 2007-12 - internal prototype

Development

Clone this wiki locally