增加密码修改、会话退出和登录记录接口
This commit is contained in:
1 parent
225ce96844
commit
e05c930a9d
9 files changed
+319
-2
No files matched your search
@@ -0,0 +1,11 @@
|
||||
ALTER TABLE devices ADD COLUMN name_custom boolean NOT NULL DEFAULT false;
|
||||
|
||||
CREATE TABLE login_history (
|
||||
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
device_id uuid NOT NULL REFERENCES devices(id) ON DELETE CASCADE,
|
||||
device_name text NOT NULL,
|
||||
platform text NOT NULL CHECK (platform IN ('web','windows')),
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE INDEX login_history_user ON login_history(user_id,id DESC);
|
||||
@@ -49,6 +49,9 @@ var contactMuteMigration string
|
||||
//go:embed 014_private_conversations.sql
|
||||
var privateConversationsMigration string
|
||||
|
||||
//go:embed 015_login_history.sql
|
||||
var loginHistoryMigration string
|
||||
|
||||
func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
|
||||
tx, err := pool.Begin(ctx)
|
||||
if err != nil {
|
||||
@@ -64,7 +67,7 @@ func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
|
||||
for index, migration := range []string{
|
||||
identityMigration, contactsMigration, deliveryMigration, keyPackagesMigration, mlsCredentialsMigration,
|
||||
attachmentsMigration, groupsMigration, groupTransportMigration, groupAttachmentsMigration, groupPreferencesMigration,
|
||||
groupSeenMigration, groupInviteLinkMigration, contactMuteMigration, privateConversationsMigration,
|
||||
groupSeenMigration, groupInviteLinkMigration, contactMuteMigration, privateConversationsMigration, loginHistoryMigration,
|
||||
} {
|
||||
version := index + 1
|
||||
var applied bool
|
||||
|
||||
Reference in new issue
Block a user