BUG: Need to copy computation_strategies when making a copy.

It just doesn't make logical sense though... and if it ever filters out the
one dataset_copies row that can be returned by querying on the unique
constraint, then the query won't even work.

    "dataset_copies_dataset_system_id_copy_number" UNIQUE CONSTRAINT, btree
(dataset_system_id, copy_number)

On Wed, Oct 1, 2014 at 11:49 AM, Chi <notifications@github.com> wrote:

> In
> soda-fountain-lib/src/main/scala/com/socrata/soda/server/persistence/pg/PostgresStoreImpl.scala:
>
> > @@ -633,6 +633,23 @@ class PostgresStoreImpl(dataSource: DataSource) extends NameAndSchemaStore {
> >            |           (SELECT id FROM dataset_copies WHERE dataset_system_id = ? And copy_number = ? And deleted_at is null)
> >            |      FROM columns
> >            |     WHERE copy_id = (SELECT id FROM tmp_last_copy);
> > +        INSERT INTO computation_strategies (
> > +          |    dataset_system_id,
> > +          |    column_id,
> > +          |    computation_strategy_type,
> > +          |    recompute,
> > +          |    source_columns,
> > +          |    parameters,
> > +          |    copy_id)
> > +          |    SELECT dataset_system_id,
> > +          |           column_id,
> > +          |           computation_strategy_type,
> > +          |           recompute,
> > +          |           source_columns,
> > +          |           parameters,
> > +          |           (SELECT id FROM dataset_copies WHERE dataset_system_id = ? And copy_number = ? And deleted_at is null)
>
> It could be redundant. But I rather have it than not have it.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/socrata/soda-fountain/pull/40/files#r18299587>.
>