Skip to content

Commit

Permalink
Seed, annotate, yarn, docker, what not
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNaessens committed Mar 17, 2024
1 parent 5966ffe commit 52186eb
Show file tree
Hide file tree
Showing 13 changed files with 705 additions and 78 deletions.
14 changes: 7 additions & 7 deletions app/models/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#
# Table name: addresses
#
# id :integer not null, primary key
# beneficiary :string
# city :string not null
# country :string not null
# id :bigint not null, primary key
# beneficiary :string(255)
# city :string(255) not null
# country :string(255) not null
# deleted_at :datetime
# street :string not null
# zip_code :string not null
# contact_id :integer not null
# street :string(255) not null
# zip_code :string(255) not null
# contact_id :bigint not null
#
# Indexes
#
Expand Down
6 changes: 3 additions & 3 deletions app/models/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
# Table name: contacts
#
# id :integer not null, primary key
# id :bigint not null, primary key
# deleted_at :datetime
# name :string not null
# vatnumber :string
# name :string(255) not null
# vatnumber :string(255)
#
# Indexes
#
Expand Down
6 changes: 3 additions & 3 deletions app/models/cost.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#
# Table name: costs
#
# id :integer not null, primary key
# id :bigint not null, primary key
# amount :integer default(1), not null
# deleted_at :datetime
# description :string not null
# description :string(255) not null
# price :decimal(8, 2) default(0.0), not null
# vat :integer default("v21"), not null
# note_id :integer
# note_id :bigint
#
# Indexes
#
Expand Down
10 changes: 5 additions & 5 deletions app/models/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#
# Table name: notes
#
# id :integer not null, primary key
# id :bigint not null, primary key
# deleted_at :datetime
# generated_pdf :binary
# generated_pdf :binary(429496729
# kind :integer default("invoice"), not null
# note_number :string not null
# title :string not null
# note_number :string(255) not null
# title :string(255) not null
# created_at :datetime not null
# updated_at :datetime not null
# contact_id :integer
# contact_id :bigint
#
# Indexes
#
Expand Down
27 changes: 11 additions & 16 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
adapter: mysql2
encoding: utf8
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: factuur
password: password
database: factuur
host: 127.0.0.1
port: 3306

development:
<<: *default
database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3

database: factuur-test
port: 3307

production:
url: <%= ENV['DATABASE_URL'] %>
<<: *default
16 changes: 8 additions & 8 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,44 @@

ActiveRecord::Schema.define(version: 2020_01_04_144931) do

create_table "addresses", force: :cascade do |t|
create_table "addresses", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.string "beneficiary"
t.string "street", null: false
t.string "zip_code", null: false
t.string "city", null: false
t.string "country", null: false
t.integer "contact_id", null: false
t.bigint "contact_id", null: false
t.datetime "deleted_at"
t.index ["contact_id"], name: "index_addresses_on_contact_id"
t.index ["deleted_at"], name: "index_addresses_on_deleted_at"
end

create_table "contacts", force: :cascade do |t|
create_table "contacts", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.string "name", null: false
t.string "vatnumber"
t.datetime "deleted_at"
t.index ["deleted_at"], name: "index_contacts_on_deleted_at"
end

create_table "costs", force: :cascade do |t|
create_table "costs", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.string "description", null: false
t.decimal "price", precision: 8, scale: 2, default: "0.0", null: false
t.integer "amount", default: 1, null: false
t.integer "vat", default: 21, null: false
t.integer "note_id"
t.bigint "note_id"
t.datetime "deleted_at"
t.index ["deleted_at"], name: "index_costs_on_deleted_at"
t.index ["note_id"], name: "index_costs_on_note_id"
end

create_table "notes", force: :cascade do |t|
create_table "notes", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "kind", default: 0, null: false
t.string "note_number", null: false
t.string "title", null: false
t.binary "generated_pdf", limit: 16777216
t.integer "contact_id"
t.binary "generated_pdf", size: :long
t.bigint "contact_id"
t.datetime "deleted_at"
t.index ["contact_id"], name: "index_notes_on_contact_id"
t.index ["deleted_at"], name: "index_notes_on_deleted_at"
Expand Down
22 changes: 19 additions & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,31 @@ version: '3.3'

services:
db:
image: mysql:5.7
image: mariadb:11
volumes:
- db_data:/var/lib/mysql
- factuur_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: strong-password
MYSQL_DATABASE: factuur
MYSQL_USER: factuur
MYSQL_PASSWORD: password
ports:
- "3306:3306"

db-test:
image: mariadb:11
volumes:
- factuur_test_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: strong-password
MYSQL_DATABASE: factuur-test
MYSQL_USER: factuur
MYSQL_PASSWORD: password
ports:
- "3307:3307"

volumes:
db_data: {}
factuur_data:
factuur_test_data:
14 changes: 7 additions & 7 deletions test/fixtures/addresses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
#
# Table name: addresses
#
# id :integer not null, primary key
# beneficiary :string
# city :string not null
# country :string not null
# id :bigint not null, primary key
# beneficiary :string(255)
# city :string(255) not null
# country :string(255) not null
# deleted_at :datetime
# street :string not null
# zip_code :string not null
# contact_id :integer not null
# street :string(255) not null
# zip_code :string(255) not null
# contact_id :bigint not null
#
# Indexes
#
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/contacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
# Table name: contacts
#
# id :integer not null, primary key
# id :bigint not null, primary key
# deleted_at :datetime
# name :string not null
# vatnumber :string
# name :string(255) not null
# vatnumber :string(255)
#
# Indexes
#
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#
# Table name: notes
#
# id :integer not null, primary key
# id :bigint not null, primary key
# deleted_at :datetime
# generated_pdf :binary(16777216)
# generated_pdf :binary(429496729
# kind :integer default("invoice"), not null
# note_number :string not null
# title :string not null
# note_number :string(255) not null
# title :string(255) not null
# created_at :datetime not null
# updated_at :datetime not null
# contact_id :integer
# contact_id :bigint
#
# Indexes
#
Expand Down
6 changes: 3 additions & 3 deletions test/models/contact_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
# Table name: contacts
#
# id :integer not null, primary key
# id :bigint not null, primary key
# deleted_at :datetime
# name :string not null
# vatnumber :string
# name :string(255) not null
# vatnumber :string(255)
#
# Indexes
#
Expand Down
10 changes: 5 additions & 5 deletions test/models/note_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#
# Table name: notes
#
# id :integer not null, primary key
# id :bigint not null, primary key
# deleted_at :datetime
# generated_pdf :binary(16777216)
# generated_pdf :binary(429496729
# kind :integer default("invoice"), not null
# note_number :string not null
# title :string not null
# note_number :string(255) not null
# title :string(255) not null
# created_at :datetime not null
# updated_at :datetime not null
# contact_id :integer
# contact_id :bigint
#
# Indexes
#
Expand Down
Loading

0 comments on commit 52186eb

Please sign in to comment.