spazio-solazzo/priv/repo/migrations/20260202155008_add_booking_indexes.exs
Víctor Martínez 69f992f8f6
feat: new booking system + admin dashboard (#12)
feat: implement a new booking system and admin dashboard
2026-02-07 19:08:39 +01:00

29 lines
749 B
Elixir

defmodule SpazioSolazzo.Repo.Migrations.AddBookingIndexes do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
create index(:bookings, [:end_datetime])
create index(:bookings, [:start_datetime])
create index(:bookings, [:space_id, :state])
create index(:bookings, [:space_id, :start_datetime, :end_datetime])
end
def down do
drop_if_exists index(:bookings, [:space_id, :start_datetime, :end_datetime])
drop_if_exists index(:bookings, [:space_id, :state])
drop_if_exists index(:bookings, [:start_datetime])
drop_if_exists index(:bookings, [:end_datetime])
end
end