Skip to content

Commit

Permalink
Split TSDB sample config, rename in compose and push initial download…
Browse files Browse the repository at this point in the history
…s schema.
  • Loading branch information
simi committed May 31, 2024
1 parent 8a9a276 commit 7b3f763
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 33 deletions.
36 changes: 6 additions & 30 deletions config/database.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ default: &default
username: postgres
prepared_statements: false

timescale: &timescale
adapter: postgresql
encoding: utf8
username: postgres
password: devpassword
migrations_paths: db/downloads_migrate
port: 5434

development:
primary:
<<: *default
Expand All @@ -20,12 +12,7 @@ development:
password: devpassword
pool: 5
timeout: 5000
downloads:
<<: *timescale
database: rubygems_tsdb_development
host: localhost
pool: 5
timeout: 5000


test:
primary:
Expand All @@ -36,13 +23,6 @@ test:
password: testpassword
pool: 5
timeout: 5000
downloads:
<<: *timescale
database: rubygems_tsdb_test
host: localhost
min_messages: warning
pool: 5
timeout: 5000

oidc-api-token:
primary:
Expand All @@ -51,9 +31,11 @@ oidc-api-token:
min_messages: error
pool: 30
reconnect: true
downloads:
<<: *timescale
database: rubygems_tsdb_staging

staging:
primary:
<<: *default
database: rubygems_staging
min_messages: error
pool: 30
reconnect: true
Expand All @@ -65,9 +47,3 @@ production:
min_messages: error
pool: 30
reconnect: true
downloads:
<<: *timescale
database: rubygems_tsdb_production
min_messages: error
pool: 30
reconnect: true
59 changes: 59 additions & 0 deletions config/database.yml.ts-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
default: &default
adapter: postgresql
encoding: utf8
username: postgres
prepared_statements: false

timescale: &timescale
adapter: postgresql
encoding: utf8
username: postgres
password: devpassword
migrations_paths: db/downloads_migrate
port: 5434

development:
primary:
<<: *default
database: rubygems_development
host: localhost
password: devpassword
pool: 5
timeout: 5000
downloads:
<<: *timescale
database: rubygems_tsdb_development
host: localhost
pool: 5
timeout: 5000

test:
primary:
<<: *default
database: rubygems_test
host: localhost
min_messages: warning
password: testpassword
pool: 5
timeout: 5000
downloads:
<<: *timescale
database: rubygems_tsdb_test
host: localhost
min_messages: warning
pool: 5
timeout: 5000

production:
primary:
<<: *default
database: rubygems_production
min_messages: error
pool: 30
reconnect: true
downloads:
<<: *timescale
database: rubygems_tsdb_production
min_messages: error
pool: 30
reconnect: true
29 changes: 29 additions & 0 deletions db/downloads_schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 0) do
create_schema "_timescaledb_cache"
create_schema "_timescaledb_catalog"
create_schema "_timescaledb_config"
create_schema "_timescaledb_debug"
create_schema "_timescaledb_functions"
create_schema "_timescaledb_internal"
create_schema "timescaledb_experimental"
create_schema "timescaledb_information"
create_schema "toolkit_experimental"

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "timescaledb"
enable_extension "timescaledb_toolkit"

end
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ services:
db:
image: postgres:13.14
environment:
POSTGRES_PASSWORD: devpassword
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- "5432:5432"
timescale:
downloads-db:
image: timescale/timescaledb-ha:pg16.2-ts2.14.2-all
ports:
- "5434:5432"
environment:
POSTGRES_PASSWORD: devpassword
- POSTGRES_HOST_AUTH_METHOD=trust
cache:
image: memcached:1.4.39
ports:
Expand Down

0 comments on commit 7b3f763

Please sign in to comment.