Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .amber.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: app
database: sqlite
database: pg
language: slang
model: granite
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amberframework/amber:v0.10.0
FROM amberframework/amber:v0.11.3

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ process_count: 1
# ssl_key_file:
# ssl_cert_file:
redis_url: "redis://localhost:6379"
database_url: sqlite3:./db/jumpcloud_connect_development.db
database_url: "postgres://admin:password@db:5432/project_ci_development"
auto_reload: true

session:
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ process_count: 1
# ssl_key_file:
# ssl_cert_file:
redis_url: "redis://localhost:6379"
database_url: sqlite3:./db/jumpcloud_connect_test.db
database_url: "postgres://admin:password@db:5432/project_ci_test"
auto_reload: false

session:
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/database.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "granite/adapter/sqlite"
require "granite/adapter/pg"

Granite::Adapters << Granite::Adapter::Sqlite.new({name: "sqlite", url: Amber.settings.database_url})
Granite::Adapters << Granite::Adapter::Pg.new({name: "pg", url: Amber.settings.database_url})
Granite.settings.logger = Amber.settings.logger.dup
Granite.settings.logger.progname = "Granite"

23 changes: 18 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
image: jumpcloud_connect
command: amber watch
environment:
DATABASE_URL: sqlite3:./db/jumpcloud_connect_development.db
DATABASE_URL: postgres://admin:password@db:5432/project_ci_development
ports:
- 3000:3000
links:
Expand All @@ -21,19 +21,32 @@ services:
image: jumpcloud_connect
command: bash -c 'amber db migrate seed'
environment:
DATABASE_URL: sqlite3:./db/jumpcloud_connect_development.db
DATABASE_URL: postgres://admin:password@db:5432/project_ci_development
volumes:
- .:/app
links:
- db

db:
image: jumpcloud_connect
command: 'bash -c "ls > /dev/null"'
image: postgres
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
POSTGRES_DB: project_ci_development
volumes:
- db:/app/local/db
- db:/var/lib/postgresql/data

mailCatcher:
image: schickling/mailcatcher
environment:
MAILCATCHER_PORT_1025_TCP_ADDR: 1025
ports:
- 1025:25
- 1080:1080


volumes:
db:
nodes:
shards:

4 changes: 2 additions & 2 deletions public/dist/main.bundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ dependencies:
github: amberframework/jasper-helpers
version: ~> 0.2.0

sqlite3:
github: crystal-lang/crystal-sqlite3
version: ~> 0.10.0
pg:
github: will/crystal-pg
version: ~> 0.15.0

citrine-i18n:
github: amberframework/citrine-i18n
Expand Down
2 changes: 1 addition & 1 deletion src/models/user.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require "crypto/bcrypt/password"

class User < Granite::Base
include Crypto
adapter sqlite
adapter pg
table_name users

primary id : Int64
Expand Down