This commit is contained in:
@@ -15,18 +15,41 @@ namespace AyaNova.Models
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public uint Concurrency { get; set; }
|
public uint Concurrency { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
[Required]
|
||||||
public bool Active { get; set; }
|
public bool Active { get; set; }
|
||||||
public string Notes { get; set; }
|
public string Notes { get; set; }
|
||||||
public string Wiki { get; set; }
|
public string Wiki { get; set; }
|
||||||
public string CustomFields { get; set; }
|
public string CustomFields { get; set; }
|
||||||
public List<string> Tags { get; set; }
|
public List<string> Tags { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public string PartNumber { get; set; }
|
||||||
|
public string PopUpNotes { get; set; }
|
||||||
|
public long? ManufacturerId { get; set; }
|
||||||
|
public string ManufacturerNumber { get; set; }
|
||||||
|
public long? WholeSalerId { get; set; }
|
||||||
|
public string WholeSalerNumber { get; set; }
|
||||||
|
public long? AlternativeWholeSalerId { get; set; }
|
||||||
|
public string AlternativeWholeSalerNumber { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal Cost { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal Retail { get; set; }
|
||||||
|
public long? UnitOfMeasureId { get; set; }
|
||||||
|
public string UPC { get; set; }
|
||||||
|
[Required]
|
||||||
|
public bool TrackSerialNumber { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public Part()
|
public Part()
|
||||||
{
|
{
|
||||||
Tags = new List<string>();
|
Tags = new List<string>();
|
||||||
|
Active = true;
|
||||||
|
TrackSerialNumber = false;
|
||||||
|
Cost = 0m;
|
||||||
|
Retail = 0m;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMapped, JsonIgnore]
|
[NotMapped, JsonIgnore]
|
||||||
@@ -35,3 +58,41 @@ namespace AyaNova.Models
|
|||||||
}//eoc
|
}//eoc
|
||||||
|
|
||||||
}//eons
|
}//eons
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
CREATE TABLE [dbo].[APART](
|
||||||
|
[AID] [uniqueidentifier] NOT NULL,
|
||||||
|
[ACREATED] [datetime] NULL,
|
||||||
|
[AMODIFIED] [datetime] NULL,
|
||||||
|
[AACTIVE] [bit] NOT NULL,
|
||||||
|
[ACREATOR] [uniqueidentifier] NULL,
|
||||||
|
[AMODIFIER] [uniqueidentifier] NULL,
|
||||||
|
[ANAME] [nvarchar](255) NULL,
|
||||||
|
[AALERT] [ntext] NULL,//DROP was deprecated and unusued in v7
|
||||||
|
[ANOTES] [ntext] NULL,
|
||||||
|
[APARTNUMBER] [nvarchar](255) NOT NULL,
|
||||||
|
[APARTCATEGORYID] [uniqueidentifier] NULL,//DROP now a tag
|
||||||
|
[AMANUFACTURERID] [uniqueidentifier] NULL,
|
||||||
|
[AWHOLESALERID] [uniqueidentifier] NULL,
|
||||||
|
[AMANUFACTURERNUMBER] [nvarchar](255) NULL,
|
||||||
|
[AWHOLESALERNUMBER] [nvarchar](255) NULL,
|
||||||
|
[AALTERNATIVEWHOLESALERID] [uniqueidentifier] NULL,
|
||||||
|
[AALTERNATIVEWHOLESALERNUMBER] [nvarchar](255) NULL,
|
||||||
|
[ACOST] [decimal](19, 5) NULL,
|
||||||
|
[ARETAIL] [decimal](19, 5) NULL,
|
||||||
|
[AUNITOFMEASUREID] [uniqueidentifier] NULL,
|
||||||
|
[APARTASSEMBLYID] [uniqueidentifier] NULL,//DROP, Migrate into new partassemblyitem
|
||||||
|
[AUPC] [nvarchar](255) NULL,
|
||||||
|
[ATRACKSERIALNUMBER] [bit] NOT NULL,
|
||||||
|
[ACUSTOM1] [ntext] NULL,
|
||||||
|
[ACUSTOM2] [ntext] NULL,
|
||||||
|
[ACUSTOM3] [ntext] NULL,
|
||||||
|
[ACUSTOM4] [ntext] NULL,
|
||||||
|
[ACUSTOM5] [ntext] NULL,
|
||||||
|
[ACUSTOM6] [ntext] NULL,
|
||||||
|
[ACUSTOM7] [ntext] NULL,
|
||||||
|
[ACUSTOM8] [ntext] NULL,
|
||||||
|
[ACUSTOM9] [ntext] NULL,
|
||||||
|
[ACUSTOM0] [ntext] NULL,
|
||||||
|
*/
|
||||||
@@ -686,16 +686,14 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
await ExecQueryAsync("CREATE INDEX apart_tags ON apart using GIN(tags)");
|
await ExecQueryAsync("CREATE INDEX apart_tags ON apart using GIN(tags)");
|
||||||
|
|
||||||
//PARTASSEMBLY
|
//PARTASSEMBLY
|
||||||
await ExecQueryAsync("CREATE TABLE apart (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool not null, " +
|
await ExecQueryAsync("CREATE TABLE apartassembly (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool not null, " +
|
||||||
"notes text, wiki text, customfields text, tags varchar(255) ARRAY )");
|
"notes text, wiki text, customfields text, tags varchar(255) ARRAY )");
|
||||||
await ExecQueryAsync("CREATE UNIQUE INDEX apart_name_id_idx ON apart (id, name);");
|
await ExecQueryAsync("CREATE UNIQUE INDEX apart_name_id_idx ON apartassembly (id, name);");
|
||||||
await ExecQueryAsync("CREATE INDEX apart_tags ON apart using GIN(tags)");
|
await ExecQueryAsync("CREATE INDEX apart_tags ON apartassembly using GIN(tags)");
|
||||||
|
|
||||||
//PARTASSEMBLYITEM
|
//PARTASSEMBLYITEM
|
||||||
await ExecQueryAsync("CREATE TABLE apartassemblyitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, partassemblyid bigint not null REFERENCES apartassembly, " +
|
await ExecQueryAsync("CREATE TABLE apartassemblyitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, partassemblyid bigint not null REFERENCES apartassembly, " +
|
||||||
"key text not null, display text not null)");
|
"partid bigint not null REFERENCES apart)");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//PROJECT
|
//PROJECT
|
||||||
await ExecQueryAsync("CREATE TABLE aproject (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool not null, " +
|
await ExecQueryAsync("CREATE TABLE aproject (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool not null, " +
|
||||||
|
|||||||
Reference in New Issue
Block a user