mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
Merge pull request #3209 from logto-io/gao-fix-alteration-script
refactor: fix alteration script
This commit is contained in:
commit
77d90e8e4e
3 changed files with 4 additions and 2 deletions
|
@ -14,7 +14,7 @@ const allAlterations = execSync("pnpm cli db alter list", {
|
|||
.filter((filename) => Boolean(filename))
|
||||
.map((filename) => filename.replace(".js", ""));
|
||||
|
||||
const diffFiles = execSync("git diff --name-only HEAD HEAD~1", {
|
||||
const diffFiles = execSync("git diff HEAD~1 HEAD --name-only --diff-filter=ACR", {
|
||||
encoding: "utf-8",
|
||||
});
|
||||
const committedAlterations = diffFiles
|
||||
|
|
|
@ -202,6 +202,7 @@ export const createUserQueries = (pool: CommonQueryMethods) => {
|
|||
pool.exists(sql`
|
||||
select ${fields.id}
|
||||
from ${table}
|
||||
where ${fields.isSuspended} = false
|
||||
limit 1
|
||||
`);
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ const alteration: AlterationScript = {
|
|||
const hasActiveUsers = await pool.exists(sql`
|
||||
select id
|
||||
from users
|
||||
where tenant_id = 'default'
|
||||
where tenant_id = 'admin'
|
||||
and is_suspended = false
|
||||
limit 1
|
||||
`);
|
||||
await pool.query(sql`
|
||||
|
|
Loading…
Reference in a new issue