- Create settings table for site-wide key-value configuration - Create images table for BLOB storage of logo/header images - Add Setting schema with JSON/string/integer/boolean support - Add ThemeSettings embedded schema with all theme options - Add Settings context with get/put/update operations - Add Media context for image uploads and retrieval - Add Image schema with SVG detection and storage - Add 9 curated theme presets (gallery, studio, boutique, etc.) - Add comprehensive tests for Settings and Media contexts - Add seeds with default Studio preset - All tests passing (29 tests, 0 failures)
21 lines
604 B
Elixir
21 lines
604 B
Elixir
# Script for populating the database. You can run it as:
|
|
#
|
|
# mix run priv/repo/seeds.exs
|
|
#
|
|
# Inside the script, you can read and write to any of your
|
|
# repositories directly:
|
|
#
|
|
# SimpleshopTheme.Repo.insert!(%SimpleshopTheme.SomeSchema{})
|
|
#
|
|
# We recommend using the bang functions (`insert!`, `update!`
|
|
# and so on) as they will fail if something goes wrong.
|
|
|
|
alias SimpleshopTheme.Settings
|
|
|
|
# Set default theme settings (Studio preset)
|
|
IO.puts("Setting up default theme settings...")
|
|
|
|
{:ok, _theme} = Settings.apply_preset(:studio)
|
|
|
|
IO.puts("✓ Default theme settings applied (Studio preset)")
|