Hi,
I'm having trouble using fqdb to create a database in mysql
fqdb createdb --dsn='DBI:mysql:database=test;host=tobymac'
The result (see below) seems to say that mysql does not like the
default value of 0 for marketID. I'm happy to help and will start
poking around a bit myself. Please let me know if you have any
questions or suggestions.
Cheers!
tim.
[fatshark@tobymac Desktop]$ fqdb createdb
--dsn='DBI:mysql:database=test;host=tobymac'
Finance::QuoteDB Copyright (C) 2008 Erik Colson
This program comes with ABSOLUTELY NO WARRANTY; for details type `fqdb -w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `fqdb -c' for details.
DBIx::Class::Schema::deploy(): DBI Exception: DBD::mysql::db do
failed: Invalid default value for 'marketID' [for Statement "
CREATE TABLE `FQMarket` (
`marketID` integer NOT NULL DEFAULT '0' auto_increment,
`name` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`marketID`)
) ENGINE=InnoDB"] at
/usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
(running "
CREATE TABLE `FQMarket` (
`marketID` integer NOT NULL DEFAULT '0' auto_increment,
`name` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`marketID`)
) ENGINE=InnoDB") at
/usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
DBIx::Class::Schema::deploy(): DBI Exception: DBD::mysql::db do
failed: Invalid default value for 'fqfailover' [for Statement "
CREATE TABLE `symbol` (
`symbolID` varchar(20) NOT NULL DEFAULT '',
`fqmarket` integer DEFAULT '0',
`fqsymbol` varchar(20) NOT NULL DEFAULT '',
`fqfailover` enum('0','1') NOT NULL DEFAULT 'FALSE',
`name` varchar(40) DEFAULT '',
`isin` varchar(12) DEFAULT '',
`currency` varchar(4) DEFAULT '',
INDEX symbol_idx_fqmarket (`fqmarket`),
PRIMARY KEY (`symbolID`),
CONSTRAINT `symbol_fk_fqmarket` FOREIGN KEY (`fqmarket`) REFERENCES
`FQMarket` (`marketID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB"] at
/usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
(running "
CREATE TABLE `symbol` (
`symbolID` varchar(20) NOT NULL DEFAULT '',
`fqmarket` integer DEFAULT '0',
`fqsymbol` varchar(20) NOT NULL DEFAULT '',
`fqfailover` enum('0','1') NOT NULL DEFAULT 'FALSE',
`name` varchar(40) DEFAULT '',
`isin` varchar(12) DEFAULT '',
`currency` varchar(4) DEFAULT '',
INDEX symbol_idx_fqmarket (`fqmarket`),
PRIMARY KEY (`symbolID`),
CONSTRAINT `symbol_fk_fqmarket` FOREIGN KEY (`fqmarket`) REFERENCES
`FQMarket` (`marketID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB") at
/usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
DBIx::Class::Schema::deploy(): DBI Exception: DBD::mysql::db do
failed: Invalid default value for 'date' [for Statement "
CREATE TABLE `quote` (
`symbolID` varchar(20) NOT NULL DEFAULT '',
`date` date NOT NULL DEFAULT '',
`previous_close` float DEFAULT '0',
`day_open` float DEFAULT '0',
`day_high` float DEFAULT '0',
`day_low` float DEFAULT '0',
`day_close` float DEFAULT '0',
`bid` integer DEFAULT '0',
`ask` integer DEFAULT '0',
`volume` integer DEFAULT '0',
INDEX quote_idx_symbolID (`symbolID`),
PRIMARY KEY (`symbolID`, `date`),
CONSTRAINT `quote_fk_symbolID` FOREIGN KEY (`symbolID`) REFERENCES
`symbol` (`symbolID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB"] at
/usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
(running "
CREATE TABLE `quote` (
`symbolID` varchar(20) NOT NULL DEFAULT '',
`date` date NOT NULL DEFAULT '',
`previous_close` float DEFAULT '0',
`day_open` float DEFAULT '0',
`day_high` float DEFAULT '0',
`day_low` float DEFAULT '0',
`day_close` float DEFAULT '0',
`bid` integer DEFAULT '0',
`ask` integer DEFAULT '0',
`volume` integer DEFAULT '0',
INDEX quote_idx_symbolID (`symbolID`),
PRIMARY KEY (`symbolID`, `date`),
CONSTRAINT `quote_fk_symbolID` FOREIGN KEY (`symbolID`) REFERENCES
`symbol` (`symbolID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB") at
/usr/lib/perl5/site_perl/5.10.1/Finance/QuoteDB/Schema.pm line 22
[fatshark@tobymac Desktop]$