mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-24 19:59:50 -04:00
10 lines
365 B
MySQL
10 lines
365 B
MySQL
|
-- Add up migration script here
|
||
|
create temp table TEMP_plan_dates_deduped AS
|
||
|
select distinct user_id, plan_date from plan_recipes;
|
||
|
|
||
|
create table plan_table (user_id TEXT NOT NULL, plan_date TEXT NOT NULL, primary key (user_id, plan_date) );
|
||
|
|
||
|
insert into plan_table
|
||
|
select user_id, plan_date from TEMP_plan_dates_deduped;
|
||
|
|
||
|
drop table TEMP_plan_dates_deduped;
|