CREATE TABLE dbo.Skills
	(
	ID int NOT NULL,
	Owner int NOT NULL,
	SkillID smallint NOT NULL,
	Upgrades smallint NOT NULL
	)  ON [PRIMARY]
GO
ALTER TABLE dbo.Skills ADD CONSTRAINT
	PK_Skills PRIMARY KEY CLUSTERED 
	(
	ID
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO
ALTER TABLE dbo.Skills ADD CONSTRAINT
	FK_Skills_Character FOREIGN KEY
	(
	Owner
	) REFERENCES dbo.Character
	(
	ID
	) ON UPDATE  NO ACTION 
	 ON DELETE  CASCADE 
	
GO
ALTER TABLE dbo.[Skills] ADD IsPassive bit NOT NULL
GO
CREATE UNIQUE NONCLUSTERED INDEX UniqueSkillPerOwner ON dbo.Skills
	(
	SkillID,
	Owner
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO