question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration using ALTER and CREATE/UPDATE in one transaction

See original GitHub issue

Observed behavior

Upgrades are failing for Postgres in case data is updated after schema alterations in this migration:

https://github.com/learningequality/kolibri/blob/30dcfe13713c21c582cfbb8e91fb375f9f13737a/kolibri/core/device/migrations/0005_auto_20191203_0951.py

Failure is Cannot ALTER TABLE device_devicesettings because it has pending trigger events

More info: https://stackoverflow.com/a/12838113

Secondary issue

We have a test environment run on Postgres, but we are not testing our migrations with data, so we cannot know if they actually work. How do we solve this?

Gherkin?

Expected behavior

User can use 0.12, add something to device_devicesettings and upgrade Kolibri afterwards.

User-facing consequences

TBC

Errors and logs

TBC

Steps to reproduce

n/a

Context

Kolibri 0.12 upgrade to 0.13.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rtibblescommented, Feb 6, 2020

Fixed in #6488

1reaction
indirectlylitcommented, Feb 3, 2020

created follow-up issues related to linting:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database: Migrations - The PHP Framework For Web Artisans
Migrations are like version control for your database, allowing your team to modify and share the application's database schema. Migrations are typically paired ......
Read more >
Flyway by Redgate • Database Migrations Made Easy.
If necessary, you can manually determine whether or not to execute a migration in a transaction. This is useful for databases like PostgreSQL...
Read more >
Migrations - typeorm - GitBook
A migration is just a single file with sql queries to update a database schema and apply new changes to an existing database....
Read more >
Ecto.Migration — Ecto SQL v3.9.2 - HexDocs
This module provides many helpers for migrating the database, allowing developers to use Elixir to alter their storage in a way that is...
Read more >
Update table and add data in a Laravel 5 Migration
So basically i have two questions: Can I use Seeds in Laravel 5 to update values or I can just insert them? Can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found