Commit graph

451 commits

Author SHA1 Message Date
Tom Hughes
eada36ff96 Switch to using the zeitwork autoloader 2020-12-30 20:30:21 +00:00
Tom Hughes
e392556444 Revert "Switch to using the zeitwork autoloader"
This reverts commit 127880a73f.
2020-12-29 19:29:36 +00:00
Tom Hughes
5677877ed1 Fix case for zeitwork 2020-12-29 18:54:12 +00:00
Tom Hughes
384ac46102 Convert id column for oauth_nonces to bigint 2020-12-14 14:48:59 +00:00
Tom Hughes
22e56a9f36 Revert accidental changes to database structure 2020-10-08 09:51:04 +01:00
Tom Hughes
06a98ad983 Index changeset comments by changeset and date 2020-10-06 23:10:52 +01:00
Tom Hughes
1946c84f71 Index changeset comments by author and date 2020-10-06 22:42:44 +01:00
Andy Allan
865d20af80 Use the db:seed task to load languages
This is seed data that should reasonably be loaded into every database,
even those that are otherwise empty (e.g. no geo data). Using the seeds
process means that it will usually be loaded by default, and is easier
to find for existing rails developers.
2020-09-30 15:09:49 +02:00
Tom Hughes
18b9b9f14c Fix new rubocop warnings 2020-09-07 07:11:22 +01:00
Tom Hughes
b1e44c1eea Fix rubocop Style/CombinableLoops warnings 2020-09-02 18:27:11 +01:00
Tom Hughes
ecd84ccce8 Allow bundle path to be overridden when building database functions 2020-02-23 20:30:29 +00:00
mmd-osm
f47aaa58c3 travis: update structure.sql 2019-12-30 12:55:59 +01:00
Tom Hughes
57f5b7840e Fix rubocop warnings 2019-12-04 19:31:53 +00:00
Tom Hughes
e6667b7ff5 Fix rubocop warnings 2019-11-27 11:47:16 +00:00
Tom Hughes
22cd2314e5 Update to rails 6.0.1 2019-11-24 11:05:02 +00:00
Andy Allan
56d9b8a4ce Remove the users.nearby column
Refs #2417 and #2432
2019-11-20 15:07:42 +01:00
Matt Amos
689821c224 Ooops, forgot to commit changes to db/structure.sql 2019-10-21 15:05:16 +01:00
Matt Amos
d3d4cff1cf Add pure SQL version of xid_to_int4. 2019-10-21 14:47:46 +01:00
Tom Hughes
3e17c3aab6 Drop postgres 9.6 specific setting from structure.sql
Closes #2404
2019-10-20 19:22:47 +01:00
Matt Amos
809b194030 Reverting part of the db/structure.sql change which had been unintentionally committed. (perhaps PG version difference?) 2019-10-04 15:38:42 +01:00
Matt Amos
098e73479b Remove shared lib PG functions from committed DB structure. 2019-10-04 13:40:27 +01:00
Matt Amos
ced8ac86ab Remove need for shared library PostgreSQL functions
This repo contains code for three functions to be loaded into PostgreSQL as a shared library:

1. `maptile_for_point`, which is used only by the `/changes` API call. This API call is little-used and IMHO should be deprecated and removed. However, even now it's hardly on the hot path for most development activities.
2. `tile_for_point`, which is used only in migrations. At this point, it seems unlikely that anyone will be doing a migration on existing data which would call this function (most developers will be running migrations on an empty database, to set it up).
3. `xid_to_int4`, which is only used for replication using Osmosis and isn't used in the Rails code at all. Hopefully this will be replaced Real Soon Now, but until then it's a quite advanced feature that most developers won't need.

Therefore, this patch proposes to replace the above three shared library functions with SQL implementations of the first two. These are _much_ slower - by a factor of about 30x, however this makes no difference when they're run on a completely empty database. In return, we're able to drop a dependency on the PostgreSQL server development package, and clean a few lines out of the installation instructions.

It's still possible to make and install the shared library functions, and I've included instructions about how to do that - although it shouldn't be necessary for the vast majority of `openstreetmap-website` developers.
2019-10-04 13:25:00 +01:00
Tom Hughes
8a39c6b4a2 Drop old user image columns 2019-07-17 19:12:30 +01:00
Tom Hughes
826b70fdc5 Replace migrations that rely on models with rake tasks
Replace some migrations that rely on relationships between
models to add subscriptions with rake tasks.
2019-07-17 18:55:15 +01:00
Tom Hughes
227c402ad1 Don't try and add fingerprints for user images
It won't actually work, and anybody migrating up to the current
schema is never going to use the fingerprints anyway.
2019-07-17 18:49:09 +01:00
Andy Allan
d130db9fa8 Avoid more models in old migrations
Although these migrations run fine today, they could break in the future
if changes are made to the current model code.
2019-07-17 12:16:20 +02:00
Andy Allan
6ebb21b660 Avoid using live models in old migrations
Instead, we define models in the migrations themselves. This ensures that
column names etc match the state of the database during the migration,
not the current live version of the model.
2019-07-17 11:52:02 +02:00
Tom Hughes
cd4ac6ac2d Revert accidental schema changes 2019-07-15 09:27:52 +01:00
Tom Hughes
550fa0c8e4 It's to_sym not to_symbol 2019-07-15 08:39:20 +01:00
Tom Hughes
ba627420a3 Add support for Active Storage attachments 2019-07-09 19:17:29 +01:00
Tom Hughes
d2d5d48f29 Allow signups to be blocked by MX host 2019-06-23 11:21:03 +01:00
Tom Hughes
1bef353c27 Update database schema 2019-05-19 17:17:25 +01:00
Tom Hughes
e78859aeaf Merge remote-tracking branch 'upstream/pull/2028' 2019-05-19 17:14:19 +01:00
Tom Hughes
8e258d810c Add some extra indexes for ACL lookups 2019-05-18 12:57:31 +01:00
Simon Poole
077834704e Add links to the ToU and include them in signup
- this adds links to the ToU in the Welcome box and on the About page
- adds a timestamp column to the users table to record acceptance of the ToU
- require ToU to be accepted before signup can proceed
- rearrange and change text on signup page
2019-05-13 16:52:18 +02:00
Tom Hughes
a8aed64eb7 Update database schema 2019-04-24 18:29:54 +01:00
Tom Hughes
b606acba0c Use rails 4.2 defaults for older migrations 2019-04-24 11:14:05 +01:00
Andy Allan
801522c5c3 Set up Delayed Job as the backend for Active Job
This persists jobs into the database, and uses locking to ensure that
workers from multiple machines avoid treading on each other.

Jobs can be run by using `bundle exec rake jobs:work`

Fixes #2015
2018-10-31 15:31:32 +01:00
Tom Hughes
de29e9b3f5 Fix Style/NumericPredicate rubocop warnings 2018-09-22 17:34:58 +01:00
Andy Allan
8db7f5aeac Alter the Makefile to be robust against bundler warnings
In bundle < 2.0, warnings are printed to stdout, along with the path information
that we need. This takes the final line of the output and assumes it's the path.

Fixes #1930
2018-08-29 12:36:31 +08:00
Tom Hughes
7441f15b4f Merge remote-tracking branch 'upstream/pull/1576' 2018-06-16 11:45:23 +01:00
Benjamin Reynolds
d5672aed4a Remove quad_tile library and extract to gem
Quad tile functions are now installed via a gem with native extension
automatically. This improves the run time of the test suite by ~30% for
users that didn't bother to build the C version of the functions.

Closes #1314
Closes #1899
2018-06-14 18:29:37 +01:00
Tom Hughes
d3700e6201 Merge branch 'master' into next 2018-06-10 17:02:12 +01:00
Tom Hughes
f227804093 Add some extra indexes on issues 2018-06-10 15:25:53 +01:00
Tom Hughes
cb0c185ce6 Update xid_to_int4 to use postgres version 1 calling convention 2018-04-28 15:16:46 +01:00
Andy Allan
7dbf8d8336 Merge branch 'master' into moderation 2018-04-11 09:54:04 +08:00
Tom Hughes
1f2ac59d1d Fix new rubocop warnings 2018-03-26 19:00:03 +01:00
Andy Allan
ee1a8637d3 Convert issue status to an enum 2018-03-21 12:05:08 +08:00
Andy Allan
5310c7000c Remove cascading deletes, add another foreign key, and switch index around. 2018-03-14 16:15:39 +08:00
Andy Allan
3e5a4a14df Ensure reports have an issue id and a user id 2018-03-14 15:36:46 +08:00