﻿CREATE TABLE [dbo].[FiltroMacchine] (
    [username]    NVARCHAR (50) NOT NULL,
    [idxMacchina] INT           NOT NULL,
    CONSTRAINT [PK_FiltroMacchine] PRIMARY KEY CLUSTERED ([username] ASC, [idxMacchina] ASC),
    CONSTRAINT [FK_FiltroMacchine_AnagMacchine] FOREIGN KEY ([idxMacchina]) REFERENCES [dbo].[AnagMacchine] ([idxMacchina]) ON DELETE CASCADE ON UPDATE CASCADE
);


GO
CREATE NONCLUSTERED INDEX [i_username]
    ON [dbo].[FiltroMacchine]([username] ASC);

