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

Change invoices.issue_date database column to NOT NULL #1107

Merged
merged 1 commit into from
Apr 23, 2019

Conversation

artur-intech
Copy link
Contributor

@artur-intech artur-intech commented Mar 15, 2019

  • Deploy only once populate_invoice_issue_date data migration is run against every deployment, since this change removes it!
  • Cannot be released along with Refactor and improve invoices #1013.

Closes #1008

@artur-intech artur-intech force-pushed the require-invoice-issue-date branch from 81bba94 to 5528697 Compare March 19, 2019 14:00
@artur-intech artur-intech force-pushed the require-invoice-issue-date branch from 5528697 to 5a83019 Compare April 3, 2019 11:42
@vohmar
Copy link
Contributor

vohmar commented Apr 8, 2019

deployment failed on staging due to null issue_date values. All the issue_date columen values are empty for that matter so apparently populate_invoice_issue_date was not run

       rake aborted!
       StandardError: An error has occurred, this and all later migrations canceled:

       PG::NotNullViolation: ERROR:  column "issue_date" contains null values
       : ALTER TABLE "invoices" ALTER "issue_date" SET NOT NULL

@vohmar vohmar assigned artur-intech and unassigned vohmar Apr 8, 2019
@artur-intech
Copy link
Contributor Author

artur-intech commented Apr 8, 2019

Then run it, what's the problem?

@artur-intech artur-intech force-pushed the require-invoice-issue-date branch from 5a83019 to 3a97eb9 Compare April 8, 2019 13:41
@vohmar
Copy link
Contributor

vohmar commented Apr 9, 2019

I cannot as db is replaced with every deployment so this migration should be run in the deployment process prior to removing it

@artur-intech
Copy link
Contributor Author

artur-intech commented Apr 9, 2019

Then talk to @ratM1n to switch to fixtures (test data we use for testing). I briefly explained him a point of them.

I could assist further, if you are OK to migrate.

https://guides.rubyonrails.org/testing.html#the-low-down-on-fixtures

P.S. I wonder how #1013 was tested if you say it's impossible to run that data migration.

@artur-intech artur-intech assigned vohmar and unassigned artur-intech Apr 9, 2019
@artur-intech artur-intech force-pushed the require-invoice-issue-date branch from 3a97eb9 to 30ea880 Compare April 13, 2019 15:00
@vohmar
Copy link
Contributor

vohmar commented Apr 23, 2019

not able to deploy

@vohmar vohmar assigned artur-intech and unassigned vohmar Apr 23, 2019
@artur-intech
Copy link
Contributor Author

How can I help?

@artur-intech artur-intech assigned vohmar and unassigned artur-intech Apr 23, 2019
@artur-intech
Copy link
Contributor Author

@ratM1n Confirmed it's now in working state.

@vohmar vohmar merged commit 1863da1 into master Apr 23, 2019
@vohmar vohmar deleted the require-invoice-issue-date branch April 30, 2019 07:27
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.

Change invoices.issue_date to NOT NULL
2 participants