Skip to content

Conversation

vincent-pochet
Copy link
Collaborator

Context

Now that we are done with #3687 to add a presence validation on the organization_id field), let's add a proper NOT NULL constraint at the DB level!

Description

This PR adds:

  • The not null constraint on theapplied_usage_thresholds table
  • Add new not_null_organization_id rails generator to make it easier to create the migration files

A lot of new migrations are coming :)

Copy link
Contributor

@julienbourdeau julienbourdeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those generators 🥰

@vincent-pochet vincent-pochet force-pushed the misc-not-null-organization-id branch from 6125f66 to 681ac97 Compare June 27, 2025 12:04
@vincent-pochet vincent-pochet merged commit f8d3216 into main Jun 27, 2025
14 checks passed
@vincent-pochet vincent-pochet deleted the misc-not-null-organization-id branch June 27, 2025 12:16
vincent-pochet added a commit that referenced this pull request Jun 30, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on `billable_metric_filters` and
`billing_entities_taxes` tables
vincent-pochet added a commit that referenced this pull request Jun 30, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `charges`
- `charges_applied_taxes`
- `charge_filters`
- `charge_filter_values`
- `commitments`
- `commitment_applied_taxes`
- `coupon_targets`
- `credits`
- `credit_notes`
- `credit_notes_applied_taxes`
- `customers_applied_taxes`
- `customer_metadata`
vincent-pochet added a commit that referenced this pull request Jun 30, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `data_export_parts`
- `data_exports`
- `dunning_campaign_thresholds`
vincent-pochet added a commit that referenced this pull request Jul 7, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `integration_items`
- `integration_resources`
- `invoice_subscriptions`
vincent-pochet added a commit that referenced this pull request Jul 7, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `payments`
- `recurring_transaction_rules`
- `refunds`
vincent-pochet added a commit that referenced this pull request Jul 7, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `wallets`
- `wallet_transactions`
- `webhooks`
vincent-pochet added a commit that referenced this pull request Jul 7, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `add_ons_taxes`
- `fees_taxes`
- `invoices_taxes`
- `plans_taxes`
vincent-pochet added a commit that referenced this pull request Jul 7, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `integration_collection_mappings`
- `integration_customers`
- `integration_mappings`
vincent-pochet added a commit that referenced this pull request Jul 7, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `invoice_metadata`
- `invoices_payment_requests`
- `usage_threshold`
vincent-pochet added a commit that referenced this pull request Jul 7, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `adjusted_fees`
- `applied_coupons`
- `payment_provider_customers`
- `applied_invoice_custom_sections`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
…3879)

## Context
Now that we are done with #3687
to add a presence validation on the organization_id field), let's add a
proper NOT NULL constraint at the DB level!

## Description

This PR adds:
- The not null constraint on  `theapplied_usage_thresholds` table
- Add new `not_null_organization_id` rails generator to make it easier
to create the migration files

A lot of new migrations are coming :)
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on `billable_metric_filters` and
`billing_entities_taxes` tables
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `charges`
- `charges_applied_taxes`
- `charge_filters`
- `charge_filter_values`
- `commitments`
- `commitment_applied_taxes`
- `coupon_targets`
- `credits`
- `credit_notes`
- `credit_notes_applied_taxes`
- `customers_applied_taxes`
- `customer_metadata`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `data_export_parts`
- `data_exports`
- `dunning_campaign_thresholds`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `integration_items`
- `integration_resources`
- `invoice_subscriptions`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `payments`
- `recurring_transaction_rules`
- `refunds`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `wallets`
- `wallet_transactions`
- `webhooks`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `add_ons_taxes`
- `fees_taxes`
- `invoices_taxes`
- `plans_taxes`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `integration_collection_mappings`
- `integration_customers`
- `integration_mappings`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `invoice_metadata`
- `invoices_payment_requests`
- `usage_threshold`
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Let's continue with not null constraint on organization_id column after
#3879

## Description

This PR adds the not null constraint on new tables:
- `adjusted_fees`
- `applied_coupons`
- `payment_provider_customers`
- `applied_invoice_custom_sections`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants