May 23, 2023, 3:54am
Anyone got any easy process to get "fresher" datetime values in the Sample Database?
For example my Orders table doesn't have anything after April 2020. I want to be able to use/demonstrate relative date filters using the sample data. I think only the new Accounts, Feedback, and Invoices tables have data over the current period (and future) which is good but it would be better if all the tables appeared "fresh".
It would be great if I could get all the datetimes shift to some offset from today. Anyone got a quick, pre-built solution?
May 23, 2023, 4:48pm
I haven’t seen any, you should pull a Postgres db and build those dates yourself
May 23, 2023, 11:18pm
I want to use the Sample Db for demonstration purposes. Used this script to freshen up the tables I'm looking at:
set @CreatedAtDaysToAdd = (select datediff(day, max(Created_at), now()) from public.orders);
set Created_at = dateadd(day, @CreatedAtDaysToAdd, Created_at);
set @PeopleCreatedAtDaysToAdd = (select datediff(day, max(Created_at), now()) from public.people);
set Created_at = dateadd(day, @PeopleCreatedAtDaysToAdd, Created_at);
set @ProductsCreatedAtDaysToAdd = (select datediff(day, max(Created_at), now()) from public.products);
set Created_at = dateadd(day, @ProductsCreatedAtDaysToAdd, Created_at);
set @ReviewsCreatedAtDaysToAdd = (select datediff(day, max(Created_at), now()) from public.reviews);
set Created_at = dateadd(day, @ReviewsCreatedAtDaysToAdd, Created_at);
set @InvoicesDateReceivedDaysToAdd = (select datediff(day, max(date_received), now()) from public.invoices);
set date_received = dateadd(day, @InvoicesDateReceivedDaysToAdd, date_received);
Not perfect but should be sufficient for my case.
EDIT: Changes made this way don't seem to stick, Metabase appears to recreate the sample db file on startup each time. Back to the drawing board ...
June 3, 2023, 11:00pm
Yes. Since it’s embedded and file based. I would suggest you use a Postgres sample db (persisting the db files) like the ones we have at