I am using liquibase v1.9.5. I will appreciate if someone can provide the contents of a functioning loadData xml (DATE field) and the corresponding csv (DATE field) contents.
Ehsan
I am using liquibase v1.9.5. I will appreciate if someone can provide the contents of a functioning loadData xml (DATE field) and the corresponding csv (DATE field) contents.
Ehsan
Check out this link for some detailed info
http://lizdouglass.wordpress.com/2009/02/01/liquibase-inserting-data-from-a-csv-file/
I also ran a small test and here’s the files
table script for MySQL
/==============================================================/
/* Table: TEST_DATA /
/==============================================================*/
create table TEST_DATA (
TEST_ID NUMERIC(20) not null,
TEST_NAME varchar(25) not null,
TEST_DATE DATE not null
);
change log to run loaddata
<?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-2.0.xsd”>
test_data.csv
----------------------------
“TEST_ID”,“TEST_NAME”,"TEST_DATE"
1,“test_1”,"2011-09-13"
2,“test_2”,"2011-09-12"
3,“test_3”,"2011-09-10"
4,“test_4”,"2011-09-14"
5,“test_5”,"2011-09-15"
6,“test_6”,"2011-09-16"
7,“test_7”,"2011-09-17"
Hope this helps!
Thanks for the test case. I created http://liquibase.jira.com/browse/CORE-1035 to track it better
Nathan