This refactors the schema package and subpackages to support editions.
An Edition is a collection of sql migrations. A given boundary binary
can have multiple migration editions. The `schema.Manager` is updated to
apply the necessary migrations in the correct order, leveraging an
Edition's priority to determine the order in which the separate Editions
are applied.
The sql migration files are now nested under a directory for the
edition.
This also switches from the generated code to using embed, which
eliminates the need for the `make migrations` target and the generated
code. As such this commit removes the target and generated code.
See:
https://pkg.go.dev/embed
29 lines
754 B
PL/PgSQL
29 lines
754 B
PL/PgSQL
begin;
|
|
|
|
-- auth_password_method_with_is_primary is useful for reading a password auth
|
|
-- method with a bool to determine if it's the scope's primary auth method.
|
|
create view auth_password_method_with_is_primary as
|
|
select
|
|
case when s.primary_auth_method_id is not null then
|
|
true
|
|
else false end
|
|
as is_primary_auth_method,
|
|
am.public_id,
|
|
am.scope_id,
|
|
am.password_conf_id,
|
|
am.name,
|
|
am.description,
|
|
am.create_time,
|
|
am.update_time,
|
|
am.version,
|
|
am.min_login_name_length,
|
|
am.min_password_length
|
|
from
|
|
auth_password_method am
|
|
left outer join iam_scope s on am.public_id = s.primary_auth_method_id;
|
|
comment on view auth_password_method_with_is_primary is
|
|
'password auth method with an is_primary_auth_method bool';
|
|
|
|
|
|
commit;
|