flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.39k stars 834 forks source link

Remove user bio column from database #1280

Closed franzliedke closed 4 years ago

franzliedke commented 7 years ago

The database column should be removed in time for the stable release. This gives people a grace period to switch to an extension as replacement.

See #1214.

franzliedke commented 6 years ago

Quoting @tobscure from https://github.com/flarum/core/pull/1214#issuecomment-343702662:

Bundled extension will come before stable release.

So that will use the existing data if available, otherwise the migration script will remove it.

askvortsov1 commented 4 years ago

A few things:

  1. https://github.com/FriendsOfFlarum/user-bio isn't bundled, was it supposed to be?
  2. How can we remove this without breaking https://github.com/FriendsOfFlarum/user-bio? We could have fof change the column name on their end and us remove the bio on our end, but i don't think thats a very elegant solution.
franzliedke commented 4 years ago

After some discussion in our last team meeting, I don't think we're willing to bundle (and support) more extensions officially until stable.

As for migration: since we're in beta, I think it would be fine if user-bio just offered a one-time script or snippet to execute once before we remove the field. We can even make that an optional step in our upgrade instructions for users of that extension.

askvortsov1 commented 4 years ago

Could we add a migration to remove the column IF there's no data in it? That way we could not have it on fresh installations without hacky workarounds

franzliedke commented 4 years ago

No. The state of all databases should be the same after running a certain migration. I could live with migrations that have checks for different states coming into the migration, but the results should be deterministic.

askvortsov1 commented 4 years ago

Fair. So we just have user bio rename the field? I'll open an issue on their end, but us actually removing the column should be delayed until the stable release to give users time to migrate user bio.

franzliedke commented 4 years ago

Either that (a migration that creates a new field and prefills it from the old field if that exists), or a one-time migration scripts for users with old data. I'll leave that choice to them.

us actually removing the column should be delayed until the stable release to give users time to migrate user bio.

Yup, see issue description. :wink:

KyrneDev commented 4 years ago

Why don't we just remove the migration from where it is created instead of just dropping it? Old forums will still have the column and new forums won't unless the install the extension. I don't see any benefit to dropped it outright.

askvortsov1 commented 4 years ago

That is a much, much better idea than this hackery I've come up with