Indexes
An example of adding an index to my ORM system
import {Index, Column, PrimaryGeneratedColumn, Table} from "@myroslavshymon/orm";
@Index({indexName: 'user_index', columns: ['username', 'email'], options: {isUnique: true}})
@Table({name: 'users'})
export class Users {
@PrimaryGeneratedColumn({type: 'BIGINT'})
user_id: number;
@Column({options: {dataType: "VARCHAR", length: 255}})
username: string;
@Column({options: {dataType: "VARCHAR", length: 255}})
email: string;
@Column({options: {dataType: "VARCHAR", length: 255}})
password: string;
@Column({options: {dataType: 'BOOLEAN', defaultValue: false}})
is_active: boolean;
}Last updated