Skip to content

Commit 2452153

Browse files
committed
Separate database.yml for wasm
1 parent 4b689da commit 2452153

File tree

3 files changed

+76
-3
lines changed

3 files changed

+76
-3
lines changed

.github/workflows/verify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ jobs:
256256
path: public
257257
- run: ls -lahR public
258258
- run: echo ${{ secrets.RAILS_MASTER_WASM_KEY }} > config/credentials/wasm.key
259+
- run: cp config/database.wasm.yml config/database.yml
259260
- run: mkdir -p .wasm
260261
- name: Build rails wasm for web
261262
run: TARGET=${{ matrix.target }} bin/wasm/build

config/database.wasm.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# SQLite. Versions 3.8.0 and up are supported.
2+
# gem install sqlite3
3+
#
4+
# Ensure the SQLite 3 gem is defined in your Gemfile
5+
# gem "sqlite3"
6+
#
7+
default: &default
8+
adapter: sqlite3
9+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 3 } %>
10+
timeout: 5000
11+
extensions:
12+
- sqlite_ulid
13+
14+
development:
15+
primary:
16+
<<: *default
17+
database: storage/development/data.sqlite3
18+
cache:
19+
<<: *default
20+
database: storage/development/cache.sqlite3
21+
migrations_paths: db/migrate_cache
22+
queue:
23+
<<: *default
24+
database: storage/development/queue.sqlite3
25+
migrations_paths: db/migrate_queue
26+
cable:
27+
<<: *default
28+
database: storage/development/cable.sqlite3
29+
migrations_paths: db/migrate_cable
30+
31+
# Warning: The database defined as "test" will be erased and
32+
# re-generated from your development database when you run "rake".
33+
# Do not set this db to the same as development or production.
34+
test:
35+
primary:
36+
<<: *default
37+
database: storage/test/data.sqlite3
38+
cache:
39+
<<: *default
40+
database: storage/test/cache.sqlite3
41+
migrations_paths: db/migrate_cache
42+
queue:
43+
<<: *default
44+
database: storage/test/queue.sqlite3
45+
migrations_paths: db/migrate_queue
46+
cable:
47+
<<: *default
48+
database: storage/test/cable.sqlite3
49+
migrations_paths: db/migrate_cable
50+
51+
# SQLite3 write its data on the local filesystem, as such it requires
52+
# persistent disks. If you are deploying to a managed service, you should
53+
# make sure it provides disk persistence, as many don't.
54+
#
55+
# Similarly, if you deploy your application as a Docker container, you must
56+
# ensure the database is located in a persisted volume.
57+
production:
58+
primary:
59+
<<: *default
60+
database: storage/production/data.sqlite3
61+
cache:
62+
<<: *default
63+
database: storage/production/cache.sqlite3
64+
migrations_paths: db/migrate_cache
65+
queue:
66+
<<: *default
67+
database: storage/production/queue.sqlite3
68+
migrations_paths: db/migrate_queue
69+
cable:
70+
<<: *default
71+
database: storage/production/cable.sqlite3
72+
migrations_paths: db/migrate_cable
73+
74+
wasm:
75+
adapter: nulldb

config/database.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,3 @@ production:
7272
<<: *default
7373
database: storage/production/cable.sqlite3
7474
migrations_paths: db/migrate_cable
75-
76-
wasm:
77-
adapter: nulldb

0 commit comments

Comments
 (0)