SET @germanLanguageId = (SELECT id FROM language WHERE name='Deutsch');
SET @systemLanguageId = 0x2fbb5fe2e29a4d70aa5854ce7ce3e20b;
SET @germanSnippetSetId = (SELECT id FROM snippet_set WHERE iso="de-DE");
SET @poundCurrencyId = (SELECT id FROM currency WHERE iso_code='GBP');
SET @salesChannelStorefrontId = (SELECT sc.id FROM sales_channel sc INNER JOIN sales_channel_translation sct ON sc.id = sct.sales_channel_id WHERE sct.name = 'Storefront');
SET @systemDomain = (SELECT scd.url FROM sales_channel_domain scd WHERE scd.sales_channel_id = @salesChannelStorefrontId AND scd.language_id = @systemLanguageId);
SET @testDomain = 'http://localhost';


UPDATE sales_channel_domain
    SET
        id = 0xf7156dbcc84049f38c14f665aef09511,
        url = @testDomain
    WHERE sales_channel_id = @salesChannelStorefrontId
      AND language_id = @systemLanguageId;

REPLACE INTO sales_channel_domain (id, sales_channel_id, language_id, currency_id, snippet_set_id, url, created_at) VALUES
 (
     0xf7156dbcc84049f38c14f665aef09510,
     @salesChannelStorefrontId,
     @germanLanguageId,
     @poundCurrencyId,
     @germanSnippetSetId,
     CONCAT(@testDomain, '/de'),
     NOW()
 );
