Hi,
we are inserting bunch of data using CSV and have generated IDs everywhere.
To insert records that reference other records there is possibility to use computedValue.
This works just fine when using ‘insert’ (i.e.
but when using ‘loadData’ it is not.
Even after specifying type=“COMPUTED” (<column name="abc type=“COMPUTED”)
I can see its is properly picked up by ColumnConfig BUT
in https://github.com/liquibase/liquibase/blob/b9c14bac81bdb4913f0e66085243427fc4b17e11/liquibase-core/src/main/java/liquibase/statement/ExecutablePreparedStatementBase.java#L125 there is no case to actually USE the
computed value.
Are we doing something wrong or is this not supported at the moment?
Thanks,
Zbynek
My change is about loadData change, so the example would be something like this
create table
load data
and CSV (my_foreign_table is already created and populated)
my_column,my_foreign_column
“myValue”,“select id from my_foreign_table where some_column=‘some_value’”
Zbynek
Hi,
value[XXX] is not used for loadData / column at the moment. I’ve implemented the defaultValue[XXX] handling which could be used in your case once it will be merged.
- add the column to the CSV without data
- Define your query in defaultValueComputed
Regards, Gyula
Hi,
That’s great! I’d like to use it also.
I just don’t see how could you use / test your change. I don’t see any code populating valueComputed from the changeLog file. Do I miss something?
Your pull request is against the master do you know when it will be released?
Thanks,
Gyula
I have already created pull request for this https://github.com/liquibase/liquibase/pull/944 and have feedback that it will be merged.