Commit Graph

250 Commits

Author SHA1 Message Date
Stanko K.R. ab07488fbd Fix int and string overflow during prod import 2025-11-18 16:16:01 +01:00
Stanko K.R. b7404087bd Fix schema incomatibilities with production 2025-11-17 20:31:42 +01:00
Stanko K.R. d915bff326 Fix admin having duplicate user after import 2025-11-17 09:12:41 -05:00
Donal McBreen 067e889cb4 Make migrations reversible 2025-11-17 09:12:40 -05:00
Donal McBreen ea970b195a Drop Search::Results table 2025-11-17 09:12:40 -05:00
Donal McBreen 28efe28f24 Replace Search::Index with Search::Records
Lean on ActiveRecord models for searching and strip out the raw SQL.
Replaces the search_index_* tables with sharded search_records_* tables
as that allows us to use a Search::Record model name.

A Class is dynamically created for each record table shard so that we
and we can access it via the Search::Record.for_account(account_id)
method.
2025-11-17 09:12:40 -05:00
Mike Dalessio fe6df7085f Finish the rollout of account_id to all core data models
Schema:
- add account_id to tables it was missing from
- make account_id a required column everywhere
- add [account_id] indexes, or add `account_id` to existing indices

Models:
- add `belongs_to :account` to all models (default to using a domain
  model's account whenever possible)
- add account_id in all the necessary fixtures
- add account_id to insert_all hashes
- pass account_id to a few initialize calls

Miscellaneous:
- update the import script to set account_id

Note that I'm not adding account_id to the join tables primarily
because I couldn't think of an easy way to populate it without making
it a full Join model, and that was more work than I have time to take
on right now.
2025-11-17 09:12:40 -05:00
Stanko K.R. edf837fed3 Drop memberships 2025-11-17 09:12:39 -05:00
Donal McBreen f4729577b6 Use uuids in the search_index tables too 2025-11-17 09:12:35 -05:00
Donal McBreen fc56ad9d7c Combine uuid-old and uuid branch changes
- Switch to binary 16 for UUID keys
- Remove AccountScopedRecord base class, all model use binary uuids now
- Fix the search sql to serialize uuids properly
- Patch the MySQL schema dumper to output binary lengths
2025-11-17 09:12:34 -05:00
Kevin McConnell 6c04b56f4b Compact the UUIDs to base36 2025-11-17 09:12:31 -05:00
Mike Dalessio e4011ef211 Update primary keys on customer data to UUIDs
- schema changes to primary and foreign keys
- fixture changes
- customer data models subclass AccountScopedRecord
- import script updated
2025-11-17 09:12:30 -05:00
Stanko K.R. 6858b96619 Simplify join codes 2025-11-17 09:12:17 -05:00
Donal McBreen 3aa4a1a562 Shard the search index into 16 tables
Create search_index_0 to search_index_15 tables and shard each index by
account id. MySQL has no ability to pre-filter fulltext indexes by
another field so this is the best bet for improving performance.

Each fulltest index internally creates 11 sub tables (see
https://dev.mysql.com/doc/refman/8.4/en/innodb-fulltext-index.html) so
actually we have 192 tables in total here.

The search_index table name is generated dynamically based on the
account_id.
2025-11-17 09:12:17 -05:00
Donal McBreen e8abc66eba MySQL search
Add a single search_index table for full-text search of cards and
comments.

For the search there is a full-text index on the title and content
columns. The board_ids is also included in the table and accessible
board ids are pre-loaded and included in the search query. This allows
us to filter out inaccessible records before joining with other tables.

Right now the search is just using boolean search. This would give us
a bunch of syntax options
(see https://dev.mysql.com/doc/refman/8.4/en/fulltext-boolean.html)
except the search query filters those out.

I've removed the searchable_by method for now - everything is built
on the assumption that there's a single search index table and all data
must fit into it.

Queries are written in SQL, we don't have a SearchIndex ActiveRecord
model. That's because we'll likely want to shard the table and it will
be simpler to just keep with the raw SQL for that.

There's no stemming, highlighting or snippet extraction yet - we are
dumping the full description in the search results.

Data can be reindexed with the search:reindex rake task.
2025-11-17 09:12:17 -05:00
Stanko K.R. 32d96db7d9 Replace card id with card number 2025-11-17 09:12:15 -05:00
Kevin McConnell 4e44cd5444 Flatten schema migrations 2025-11-17 09:11:57 -05:00
Stanko K.R. 8b1ca5e7fb Remove unused account associations 2025-11-17 09:11:42 -05:00
Stanko K.R. ba3f6b188e Add account_id to everything 2025-11-17 09:11:42 -05:00
Mike Dalessio 52ce8b50cc Switch to mysql
- trilogy adapter
- lots of small migration changes
- notably we lose the search tables which case lots of tests to fail
2025-11-17 09:11:42 -05:00
Mike Dalessio 362427b383 More changes to get setup and tests to run 2025-11-17 09:11:42 -05:00
Stanko K.R. 6705b5225f Remove the untenanted database 2025-11-17 09:11:36 -05:00
Jorge Manrubia 3a831e390f Clean watchers when losing access to board
https://app.fizzy.do/5986089/cards/2814
2025-11-06 22:02:12 +01:00
Jorge Manrubia 39ec6cf062 Replace collection with board in the code, tests green 2025-11-05 13:41:12 +01:00
Fernando Álvarez 514c0f45a2 Migrate to fizzy.do 2025-11-04 13:17:10 +01:00
Stanko K.R. fd7a9330e8 Remove email_address & password_digest from User 2025-11-04 07:20:16 +01:00
Mike Dalessio 605955fdaf Make old migration that depends on the sqlite vec0 module a no-op
Once the sqlite 'vec0' module was removed from the codebase in
38a7a144 (following the table removal in 875a298f), this migration
became unrunnable. So to make sure we can reconstruct the schema if
necessary by running all the migrations, I'm replacing it with the
creation of an empty table.
2025-11-03 17:29:25 -05:00
Jorge Manrubia 9d4dd3b00e Remove "save as draft"
Removes the creating status completely as well as the abandoned cards system. It will
always resume drafts if they exist, for a given collection and user.

https://app.box-car.com/5986089/cards/2489
2025-11-03 09:32:29 +01:00
David Heinemeier Hansson b3474ec97d Rename Entropy::Configuration to just Entropy 2025-11-02 13:11:41 +01:00
Stanko K.R. 085c7fee2e Fix Rubocop offenses 2025-10-31 16:35:44 +01:00
Stanko Krtalić 98755844a1 Remove the internal API
* Bind sessions to identities
* Remove references to the identity token
* Move email changes to identity
* Move account menu into a turbo-frame
* Create tenants from a tenanted route
2025-10-31 16:26:08 +01:00
Stanko K.R. 79b012f319 Add Join Codes 2025-10-31 16:24:30 +01:00
Stanko K.R. c8843360fe Clean up and simplify magic links 2025-10-31 16:23:38 +01:00
Stanko K.R. 5cef4ffeb0 Add sign in flow using magic links 2025-10-31 16:22:12 +01:00
Fernando Álvarez 7f78514a58 Move to app.box-car.com 2025-10-30 11:12:39 +01:00
Jorge Manrubia a98a0eb3fc Add index to sort by position 2025-10-29 17:13:31 +01:00
Jorge Manrubia 3ada6f271a Models for column positioning 2025-10-29 15:41:17 +01:00
Jorge Manrubia 1547cfd651 Merge pull request #1414 from basecamp/remove-summaries
Remove AI summaries and semantic searches
2025-10-29 12:00:57 +01:00
Jorge Manrubia 875a298f9a Remove AI summaries and semantic searches
We were not using either. We can restore if we revisit.
2025-10-29 11:55:49 +01:00
Fernando Álvarez 3946733b65 Migrate to box-car.com 2025-10-28 18:44:25 +01:00
Jorge Manrubia 9317a82570 Remove Fizzy Ask
Since we are not going to ship it
2025-10-27 14:45:30 +01:00
Jorge Manrubia 392bdae316 Rename highlights -> summary 2025-10-25 20:06:57 +02:00
Mike Dalessio 25598e75bd Fix old migration that doesn't work with Rails edge 2025-10-20 17:44:17 -07:00
Jason Zimdars c3a3f157a2 Merge branch 'main' into remove-closure-reasons 2025-10-16 13:55:13 -05:00
Jorge Manrubia 41a23b5634 Reapply "Don't relay name change events to the timeline"
This reverts commit 44d3c84e13.
2025-10-16 17:32:24 +02:00
Jorge Manrubia 44d3c84e13 Revert "Don't relay name change events to the timeline"
This reverts commit fc0b59267e.
2025-10-16 17:32:05 +02:00
Jorge Manrubia fc0b59267e Don't relay name change events to the timeline
it also adds a missing index

https://fizzy.37signals.com/5986089/cards/411
2025-10-16 17:31:51 +02:00
Jason Zimdars da413e7540 Remove closure reasons 2025-10-15 16:15:56 -05:00
Jorge Manrubia b2b05e1da8 Remove wrong migration 2025-10-15 14:31:02 +02:00
Jorge Manrubia bd178fef3c Remove null constraint 2025-10-15 14:22:44 +02:00