Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat invoice custom section migrations #2854

Merged
merged 5 commits into from
Dec 4, 2024
Merged
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
1 change: 1 addition & 0 deletions app/models/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def ensure_slug
# shipping_country :string
# shipping_state :string
# shipping_zipcode :string
# skip_invoice_custom_sections :boolean default(FALSE), not null
# slug :string
# state :string
# tax_identification_number :string
Expand Down
20 changes: 20 additions & 0 deletions db/migrate/20241122111534_create_invoice_custom_sections.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

class CreateInvoiceCustomSections < ActiveRecord::Migration[7.1]
def change
create_table :invoice_custom_sections, id: :uuid do |t|
t.string :name, null: false
t.string :code, null: false
t.string :description
t.string :display_name
t.string :details
t.references :organization, type: :uuid, null: false, foreign_key: true, index: true
t.timestamp :deleted_at

t.timestamps

t.index %i[organization_id code], unique: true
t.index %i[organization_id deleted_at]
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

class CreateInvoiceCustomSectionSelections < ActiveRecord::Migration[7.1]
def change
create_table :invoice_custom_section_selections, id: :uuid do |t|
t.references :invoice_custom_section, type: :uuid, null: false, foreign_key: true
t.references :organization, type: :uuid, null: true, foreign_key: true
t.references :customer, type: :uuid, null: true, foreign_key: true

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

class CreateAppliedInvoiceCustomSections < ActiveRecord::Migration[7.1]
def change
create_table :applied_invoice_custom_sections, id: :uuid do |t|
t.string :name, null: false
t.string :code, null: false
t.string :display_name
t.string :details
t.references :invoice, type: :uuid, null: false, foreign_key: true, index: true

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddSkipInvoiceCustomSectionsToCustomers < ActiveRecord::Migration[7.1]
def change
add_column :customers, :skip_invoice_custom_sections, :boolean, default: false, null: false
end
end
43 changes: 43 additions & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading