Skip to content

Commit ca7c353

Browse files
committed
chore: don't raise an exception if there are no stores in DB
1 parent 85fd81a commit ca7c353

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# frozen_string_literal: true
22

3-
module Maglev
4-
class MigrationV2Error < StandardError; end
5-
end
6-
73
Rails.application.config.after_initialize do
84
# Skip in test environment
95
# Only check if we're running the server or console
@@ -12,8 +8,7 @@ class MigrationV2Error < StandardError; end
128
store_exists = Maglev::SectionsContentStore.exists?
139

1410
if site_exists && !store_exists
15-
raise Maglev::MigrationV2Error,
16-
'Your Maglev site needs to be migrated to V2. Please run: rails maglev:upgrade_from_v1'
11+
Rails.logger.warn '🚨🚨🚨 Your Maglev site needs to be migrated to V2. Please run: rails maglev:upgrade_from_v1'
1712
end
1813
end
1914
end

lib/generators/maglev/templates/theme/app/theme/theme.yml.tt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ pages:
3939
- title: "Home page"
4040
path: "/index"
4141
layout_id: "default" # Use the default layout
42+
sections_content:
43+
header: []
44+
main: []
45+
footer: []
4246

4347
# List of CSS class names used by your library of icons (font awesome, remixicons, ...etc)
4448
icons: []

0 commit comments

Comments
 (0)