Page MenuHomePhabricator

Move Areas to Database

Authored by Info-Screen on Sep 16 2018, 11:31 PM.


NOTE: ./ migrate might take some time for prod databases (only once)

Fixes T23

This will change the way areas are managed.
Formerly area configuration was stored in a file, now they are also stored in the database.
This has the advantage, that posts can be linked with foregin keys to the areas.

When running migrations all posts are enumerated and every post is assigned to it's area.
These areas will have the name they had previously.
The displayname will be the same with every first letter of a word capitalized

This diff will remove the (unsupported) possibility for areas to specify a
different model and serializer for posts and comments.
Therefore post and comment ids are now garanteed to be unique accross areas.

NOTE: Areas, for which no posts exist will not survive this update and need to be created again.
NOTE: If there are posts, that specify an area that doesn't exist this area will be created in the database.
Test Plan
  • Create post
  • View Notifications (because they have the area name in the output)
  • View /areas/

Diff Detail

rAPI Server API
Lint Not Applicable
Tests Not Applicable

Event Timeline

Info-Screen retitled this revision from Summary: NOTE: `./ migrate` might take some time for prod databases (only once) to Move Areas to Database.Sep 16 2018, 11:32 PM
Info-Screen edited the summary of this revision. (Show Details)

Fix area post admin

This revision is now accepted and ready to land.Oct 6 2018, 5:59 PM
This revision was automatically updated to reflect the committed changes.