Commit adfdefa
committed
feat(coderd): prepare schema for multiple provider configs per family
Drop the unique constraint on chat_providers.provider and add
provider_config_id to chat_model_configs. This prepares the database
for multiple provider configs per family while keeping one-per-family
enforcement at the application layer.
Schema changes:
- Drop unique constraint on chat_providers.provider
- Add provider_config_id column to chat_model_configs with backfill
- Add indexes for provider_config_id and provider lookups
Backend changes:
- Support provider_config_id binding in model config CRUD
- Add provider-enablement filtering to GetEnabledChatModelConfigs
- Soft-delete model configs on provider deletion (with updated_by)
- Add application-level uniqueness guard for provider creation
- Add ensureDefaultChatModelConfig call to deleteChatProvider
- Align has_api_key / has_effective_api_key semantics
- Update dbauthz, dbmetrics, dbmock, dbcrypt wiring
Runtime and frontend changes for full multi-provider support will
follow in a separate PR.1 parent da5395a commit adfdefa
File tree
25 files changed
+2784
-421
lines changed- coderd
- database
- dbauthz
- dbmetrics
- dbmock
- migrations
- queries
- codersdk
- enterprise/dbcrypt
- site/src
- api
- pages/AgentsPage/components/ChatModelAdminPanel
25 files changed
+2784
-421
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1738 | 1738 | | |
1739 | 1739 | | |
1740 | 1740 | | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
1741 | 1748 | | |
1742 | 1749 | | |
1743 | 1750 | | |
| |||
2904 | 2911 | | |
2905 | 2912 | | |
2906 | 2913 | | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
2907 | 2921 | | |
2908 | 2922 | | |
2909 | 2923 | | |
| |||
5678 | 5692 | | |
5679 | 5693 | | |
5680 | 5694 | | |
| 5695 | + | |
| 5696 | + | |
| 5697 | + | |
| 5698 | + | |
| 5699 | + | |
| 5700 | + | |
| 5701 | + | |
5681 | 5702 | | |
5682 | 5703 | | |
5683 | 5704 | | |
| |||
5704 | 5725 | | |
5705 | 5726 | | |
5706 | 5727 | | |
| 5728 | + | |
| 5729 | + | |
| 5730 | + | |
| 5731 | + | |
| 5732 | + | |
| 5733 | + | |
| 5734 | + | |
5707 | 5735 | | |
5708 | 5736 | | |
5709 | 5737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
426 | 434 | | |
427 | 435 | | |
428 | 436 | | |
| |||
444 | 452 | | |
445 | 453 | | |
446 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
447 | 463 | | |
448 | 464 | | |
449 | 465 | | |
| |||
553 | 569 | | |
554 | 570 | | |
555 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
556 | 580 | | |
557 | 581 | | |
558 | 582 | | |
| |||
600 | 624 | | |
601 | 625 | | |
602 | 626 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | 627 | | |
620 | 628 | | |
621 | 629 | | |
| |||
683 | 691 | | |
684 | 692 | | |
685 | 693 | | |
686 | | - | |
| 694 | + | |
687 | 695 | | |
688 | 696 | | |
689 | | - | |
| 697 | + | |
690 | 698 | | |
691 | 699 | | |
692 | 700 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments