mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
环境变量支持置顶 (#2822)
* Initial plan * Add pin to top feature for environment variables Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> * Format code with prettier Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> * Add database migration for isPinned column in Envs table Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> * Use snake_case naming (is_pinned) for database column Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> Co-authored-by: whyour <imwhyour@gmail.com>
This commit is contained in:
+4
-1
@@ -1,5 +1,5 @@
|
||||
import { DataTypes, Model } from 'sequelize';
|
||||
import { sequelize } from '.';
|
||||
import { DataTypes, Model, ModelDefined } from 'sequelize';
|
||||
|
||||
export class Env {
|
||||
value?: string;
|
||||
@@ -9,6 +9,7 @@ export class Env {
|
||||
position?: number;
|
||||
name?: string;
|
||||
remarks?: string;
|
||||
isPinned?: 1 | 0;
|
||||
|
||||
constructor(options: Env) {
|
||||
this.value = options.value;
|
||||
@@ -21,6 +22,7 @@ export class Env {
|
||||
this.position = options.position;
|
||||
this.name = options.name;
|
||||
this.remarks = options.remarks || '';
|
||||
this.isPinned = options.isPinned || 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +44,5 @@ export const EnvModel = sequelize.define<EnvInstance>('Env', {
|
||||
position: DataTypes.NUMBER,
|
||||
name: { type: DataTypes.STRING, unique: 'compositeIndex' },
|
||||
remarks: DataTypes.STRING,
|
||||
isPinned: { type: DataTypes.NUMBER, field: 'is_pinned' },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user