-- Ristorazione: come e' collegata una stampante di reparto. -- -- Due modi, gli stessi gia' previsti per la stampante della cassa (PrinterConnectionType): -- 0 = Rete -> si raggiunge per indirizzo IP e porta (Address / Port, gia' presenti) -- 1 = USB -> stampante collegata via USB a un PC e CONDIVISA in rete: si raggiunge per -- percorso di condivisione Windows (PrinterPath, es. \\CASSA1\Cucina) -- -- Non e' un dettaglio di installazione: la stampa parte dal SERVER, quindi nel caso USB la -- condivisione dev'essere raggiungibile dal server e l'account del servizio deve avere i -- permessi per stamparci. Con l'IP il vincolo e' lo stesso ma piu' evidente. -- -- ConnectionType NOT NULL con default 0: le stampanti gia' censite sono tutte di rete, ed e' il -- caso in cui non c'e' niente da cambiare dopo l'aggiornamento. -- -- Idempotente: rilanciabile senza errori. IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID('RestaurantPrinters') AND name = 'ConnectionType') ALTER TABLE RestaurantPrinters ADD ConnectionType int NOT NULL CONSTRAINT DF_RestaurantPrinters_ConnectionType DEFAULT (0) IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID('RestaurantPrinters') AND name = 'PrinterPath') ALTER TABLE RestaurantPrinters ADD PrinterPath nvarchar(255) NULL