Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use _supabase database for internals #2707

Merged

Conversation

avallete
Copy link
Member

This is to avoid overloading our user postgres database with every new addition to _analytics or _realtime

What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

This is to avoid overloading our user postgres database
with every new addition to _analytics or _realtime
@coveralls
Copy link

coveralls commented Sep 24, 2024

Pull Request Test Coverage Report for Build 11074018500

Details

  • 11 of 13 (84.62%) changed or added relevant lines in 4 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 60.026%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/db/dump/dump.go 0 1 0.0%
internal/start/start.go 2 3 66.67%
Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 11043607698: -0.004%
Covered Lines: 6466
Relevant Lines: 10772

💛 - Coveralls

internal/db/start/start.go Show resolved Hide resolved
internal/db/start/templates/_supabase.sql Outdated Show resolved Hide resolved
@avallete avallete marked this pull request as ready for review September 25, 2024 07:44
@avallete avallete requested a review from a team as a code owner September 25, 2024 07:44
@@ -750,7 +750,7 @@ EOF
fmt.Sprintf("DB_PORT=%d", dbConfig.Port),
"DB_USER=supabase_admin",
"DB_PASSWORD=" + dbConfig.Password,
"DB_NAME=" + dbConfig.Database,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

realtime schema should be initialised inside the postgres database. We probably need to check with @filipecabaco if there's additional config for separating the control plane database.

psql (16.3, server 15.6)
Type "help" for help.

_supabase=> \dn
        List of schemas
    Name    |       Owner
------------+-------------------
 _analytics | postgres
 _realtime  | postgres
 _supavisor | postgres
 public     | pg_database_owner
 realtime   | postgres
(5 rows)

_supabase=> \dt realtime.*
                       List of relations
  Schema  |       Name        | Type  |          Owner
----------+-------------------+-------+-------------------------
 realtime | messages          | table | supabase_realtime_admin
 realtime | schema_migrations | table | supabase_admin
 realtime | subscription      | table | supabase_admin
(3 rows)

Copy link
Contributor

@sweatybridge sweatybridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this one is good to go. We can deal with realtime later after gaining more clarity.

@avallete avallete merged commit b64a8c8 into develop Sep 27, 2024
8 checks passed
@avallete avallete deleted the avallete/chore-create-new-supabase-management-database branch September 27, 2024 16:13
avallete added a commit to supabase/supabase that referenced this pull request Sep 30, 2024
Following: supabase/cli#2707

BREAKING CHANGES:
When migrating from an older version you will need to manually create the new internal _supabase
database and analytics schema the same way the  and  do.
Via:
avallete added a commit to supabase/supabase that referenced this pull request Oct 8, 2024
* chore: move _analytics to a distinct database

Following: supabase/cli#2707

BREAKING CHANGES:
When migrating from an older version you will need to manually create the new internal _supabase
database and analytics schema the same way the  and  do.
Via:

* feat: add supavisor to the self-hosted stack

* chore(docs): add docs about supavisor

* chore: fix reviewdog warning

* chore: fix typo

* chore: apply pr comments
encima pushed a commit to supabase/supabase that referenced this pull request Nov 19, 2024
* chore: move _analytics to a distinct database

Following: supabase/cli#2707

BREAKING CHANGES:
When migrating from an older version you will need to manually create the new internal _supabase
database and analytics schema the same way the  and  do.
Via:

* feat: add supavisor to the self-hosted stack

* chore(docs): add docs about supavisor

* chore: fix reviewdog warning

* chore: fix typo

* chore: apply pr comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants