1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3861],{9570:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tools/postgres-enum-type-generator",function(){return n(4275)}])},9824:function(e,t,n){"use strict";n.d(t,{A1:function(){return E},PU:function(){return A},V4:function(){return p}});var a=n(2676),o=n(5271),c=n(137),s=n.n(c),l=n(9965),r=n.n(l),i=n(4032),u=n(1831),d=n(3349),h=n(2427),m=n(6904);let E=e=>{let{label:t,value:n,onChange:c,placeholder:s,readOnly:l,rows:r=10}=e,[i,u]=(0,o.useState)(!1);return(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("label",{className:"text-sm font-semibold text-[#B8AFCA]",children:t}),l&&(0,a.jsx)("button",{type:"button",className:"text-xs px-3 py-1 rounded-full border border-[#3E30A8] hover:bg-[#3E30A8] transition-colors",onClick:()=>{navigator.clipboard.writeText(n),u(!0),setTimeout(()=>u(!1),1500)},children:i?"Copied!":"Copy"})]}),(0,a.jsx)("textarea",{className:"w-full rounded-[12px] bg-[#16151A] border border-[#2A2440] focus:border-[#3E30A8] focus:outline-none p-4 font-mono text-sm text-white",rows:r,value:n,onChange:e=>null==c?void 0:c(e.target.value),placeholder:s,readOnly:l,spellCheck:!1})]})},p=e=>{let{onClick:t,children:n}=e;return(0,a.jsx)("button",{type:"button",onClick:t,className:"px-6 py-2 rounded-full bg-[#3E30A8] hover:bg-[#4E40C8] transition-colors font-semibold",children:n})},A=e=>{let{label:t,value:n,onChange:o,options:c}=e;return(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-[#B8AFCA]",children:[t,(0,a.jsx)("select",{className:"bg-[#16151A] border border-[#2A2440] rounded-[8px] px-2 py-1 text-white",value:n,onChange:e=>o(e.target.value),children:c.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]})};t.ZP=e=>{let{slug:t,title:n,description:o,h1:c,intro:l,children:E,howTo:p,faq:A,afterTool:T}=e,b=m.K.filter(e=>e.slug!==t);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.Z,{title:n,description:o}),A&&A.length>0&&(0,a.jsx)(s(),{children:(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:A.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))})}})}),(0,a.jsxs)("div",{className:"min-h-screen flex flex-col pt-[80px] bg-black text-white",children:[(0,a.jsx)(i.Z,{}),(0,a.jsxs)("main",{className:"w-full max-w-5xl mx-auto px-4 md:px-8 flex-1",children:[(0,a.jsxs)("header",{className:"pt-10 pb-6 text-center",children:[(0,a.jsx)("h1",{className:"font-archivo-black text-3xl md:text-5xl font-bold mb-4",children:c}),(0,a.jsx)("p",{className:"text-[#9289A4] max-w-3xl mx-auto",children:l})]}),(0,a.jsx)("section",{className:"mb-10",children:E}),(0,a.jsxs)("section",{className:"my-12 rounded-[20px] border border-[#3E30A8] bg-[#16151A] p-8 text-center",children:[(0,a.jsxs)("h2",{className:"text-2xl font-bold mb-3",children:["Do more than ",c.toLowerCase()," â meet Chat2DB"]}),(0,a.jsx)("p",{className:"text-[#9289A4] max-w-2xl mx-auto mb-6",children:"Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace."}),(0,a.jsxs)("div",{className:"flex gap-4 justify-center flex-wrap",children:[(0,a.jsx)(r(),{href:"/download",children:(0,a.jsx)(h.Z,{variant:"primary",children:"Download Chat2DB Free"})}),(0,a.jsx)("a",{href:"https://app.chat2db.ai",target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)(h.Z,{variant:"secondary",children:"Try Chat2DB Web"})})]})]}),T,p&&p.length>0&&(0,a.jsxs)("section",{className:"my-10",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"How to use"}),(0,a.jsx)("ol",{className:"list-decimal list-inside space-y-2 text-[#B8AFCA]",children:p.map((e,t)=>(0,a.jsx)("li",{children:e},t))})]}),A&&A.length>0&&(0,a.jsxs)("section",{className:"my-10",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Frequently asked questions"}),(0,a.jsx)("div",{className:"space-y-6",children:A.map((e,t)=>(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-1",children:e.q}),(0,a.jsx)("p",{className:"text-[#9289A4]",children:e.a})]},t))})]}),(0,a.jsxs)("section",{className:"my-12",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"More free SQL tools"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:b.map(e=>(0,a.jsxs)(r(),{href:"/tools/".concat(e.slug),className:"block p-4 rounded-[12px] border border-[#2A2440] hover:border-[#4A4460] transition-colors",children:[(0,a.jsx)("div",{className:"font-semibold mb-1",children:e.name}),(0,a.jsx)("div",{className:"text-sm text-[#9289A4]",children:e.short})]},e.slug))})]})]}),(0,a.jsx)(u.Z,{})]})]})}},4275:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return h}});var a=n(2676),o=n(5271),c=n(9824);let s=[{value:"create",label:"Create enum type + column"},{value:"add",label:"Add a value (ALTER TYPE ... ADD VALUE)"},{value:"rename",label:"Rename a value"},{value:"remove",label:"Remove a value (safe recreate)"},{value:"to_check",label:"Convert enum to text + CHECK"},{value:"to_lookup",label:"Convert enum to lookup table"}],l=[{value:"end",label:"At the end (default)"},{value:"before",label:"BEFORE an existing value"},{value:"after",label:"AFTER an existing value"}],r=e=>{let t=e.trim();return t?/^[a-z_][a-z0-9_]*$/.test(t)?t:'"'.concat(t.replace(/"/g,'""'),'"'):t},i=e=>"'".concat(e.trim().replace(/'/g,"''"),"'"),u=e=>{let t=new Set;return e.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("--")).filter(e=>!t.has(e)&&(t.add(e),!0))},d=e=>{let{label:t,value:n,onChange:o,width:c="w-40"}=e;return(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-[#B8AFCA]",children:[t,(0,a.jsx)("input",{className:"bg-[#16151A] border border-[#2A2440] rounded-[8px] px-3 py-1.5 text-white focus:border-[#3E30A8] focus:outline-none font-mono text-sm ".concat(c),value:n,onChange:e=>o(e.target.value)})]})};var h=!0;t.default=()=>{let[e,t]=(0,o.useState)("create"),[n,h]=(0,o.useState)("public"),[m,E]=(0,o.useState)("order_status"),[p,A]=(0,o.useState)("pending\npaid\nshipped\ncancelled"),[T,b]=(0,o.useState)("orders"),[x,L]=(0,o.useState)("status"),[g,v]=(0,o.useState)("pending"),[N,R]=(0,o.useState)(!0),[w,f]=(0,o.useState)("refunded"),[y,C]=(0,o.useState)("end"),[O,S]=(0,o.useState)("cancelled"),[D,j]=(0,o.useState)(!0),[U,P]=(0,o.useState)("cancelled"),[k,M]=(0,o.useState)("canceled"),[I,B]=(0,o.useState)("cancelled"),[_,F]=(0,o.useState)("pending"),Y=(0,o.useMemo)(()=>{let t=u(p),a=[],o=m.trim();o||a.push("Type name is required."),t.length||a.push("Enter at least one enum value (one per line).");let c=n.trim()?"".concat(r(n),".").concat(r(o)):r(o),s=n.trim()?"".concat(r(n),".").concat(r(T.trim()||"my_table")):r(T.trim()||"my_table"),l=r(x.trim()||"status"),d=g.trim(),h=d.length>0;h&&t.length&&!t.includes(d)&&"remove"!==e&&a.push("Default value '".concat(d,"' is not one of the enum values."));let E="-- Inspect the values and their sort order\nSELECT enumlabel, enumsortorder\nFROM pg_enum\nWHERE enumtypid = ".concat(i(c),"::regtype\nORDER BY enumsortorder;"),A="",b="",L=[];switch(e){case"create":A="CREATE TYPE ".concat(c," AS ENUM (\n").concat(t.map(e=>" ".concat(i(e))).join(",\n"),"\n);\n\nALTER TABLE ").concat(s,"\n ADD COLUMN ").concat(l," ").concat(c).concat(N?" NOT NULL":"").concat(h?" DEFAULT ".concat(i(d)):"",";\n\n-- Enum values compare by declaration order, not alphabetically\nSELECT * FROM ").concat(s," WHERE ").concat(l," < ").concat(i(t[t.length-1]||d),";\n\n").concat(E),b="ALTER TABLE ".concat(s," DROP COLUMN ").concat(l,";\nDROP TYPE ").concat(c,";"),L.push("An enum value occupies 4 bytes on disk, and comparisons use the declaration order shown above, so ORDER BY on the column sorts by that order rather than alphabetically."),N&&!h&&L.push("NOT NULL without a DEFAULT fails on a table that already has rows (column contains
1null values). Add a default or backfill first."),L.push("Labels are case-sensitive and limited to 63 bytes. 'Paid' and 'paid' are different values.");break;case"add":{let e=w.trim();e||a.push("New value is required."),t.includes(e)&&a.push("'".concat(e,"' already exists in the enum.")),"end"===y||t.includes(O.trim())||a.push("Reference value '".concat(O.trim(),"' is not one of the current enum values."));let n="end"===y?"":"\n ".concat(y.toUpperCase()," ").concat(i(O));A="-- Migration 1 of 2: add the label\nALTER TYPE ".concat(c,"\n ADD VALUE").concat(D?" IF NOT EXISTS":""," ").concat(i(e)).concat(n,";\n\n-- Migration 2 of 2 (separate transaction): start using it\n-- UPDATE ").concat(s," SET ").concat(l," = ").concat(i(e)," WHERE ...;\n\n").concat(E),b='-- PostgreSQL has no ALTER TYPE ... DROP VALUE.\n-- To undo, switch the mode above to "Remove a value (safe recreate)".',L.push("Since PostgreSQL 12, ADD VALUE can run inside a transaction block, but the new label cannot be used in the same transaction (ERROR: unsafe use of new value). Keep the ALTER TYPE in its own migration and reference the value only in later migrations."),L.push("On PostgreSQL 11 and earlier, ADD VALUE cannot run inside a transaction block at all; migration tools that wrap each migration in BEGIN/COMMIT need a non-transactional migration for this step."),L.push("ADD VALUE takes a brief lock on the type but does not rewrite the table, so it is safe on large tables.");break}case"rename":{let e=U.trim(),n=k.trim();t.includes(e)||a.push("'".concat(e,"' is not one of the current enum values.")),n||a.push("New label is required."),t.includes(n)&&a.push("'".concat(n,"' already exists in the enum.")),A="ALTER TYPE ".concat(c,"\n RENAME VALUE ").concat(i(e)," TO ").concat(i(n),";\n\n").concat(E),b="ALTER TYPE ".concat(c,"\n RENAME VALUE ").concat(i(n)," TO ").concat(i(e),";"),L.push("RENAME VALUE (PostgreSQL 10+) changes the label in place: every stored row now reads as the new label and the sort position is unchanged. No table rewrite happens."),L.push("Application code, CHECK constraints, views and default expressions that spell the old label as a string literal must be updated in the same deploy.");break}case"remove":{let e=I.trim(),u=_.trim();t.includes(e)||a.push("'".concat(e,"' is not one of the current enum values.")),u&&!t.includes(u)&&a.push("Replacement '".concat(u,"' is not one of the current enum values.")),u===e&&u&&a.push("Replacement cannot be the value being removed.");let m=t.filter(t=>t!==e);m.length||a.push("Removing this value would leave the enum empty.");let p=n.trim()?"".concat(r(n),".").concat(r(o+"_new")):r(o+"_new"),T=h&&d!==e;A="BEGIN;\n\n-- 1. Make sure no row still uses the value\n".concat(u?"UPDATE ".concat(s," SET ").concat(l," = ").concat(i(u)," WHERE ").concat(l," = ").concat(i(e),";"):"-- (no replacement given) this must return 0:\n-- SELECT count(*) FROM ".concat(s," WHERE ").concat(l," = ").concat(i(e),";"),"\n\n-- 2. Create the replacement type without the value\nCREATE TYPE ").concat(p," AS ENUM (\n").concat(m.map(e=>" ".concat(i(e))).join(",\n"),"\n);\n\n-- 3. Swap the column over (this rewrites the table and takes ACCESS EXCLUSIVE)\nALTER TABLE ").concat(s," ALTER COLUMN ").concat(l," DROP DEFAULT;\nALTER TABLE ").concat(s,"\n ALTER COLUMN ").concat(l," TYPE ").concat(p,"\n USING ").concat(l,"::text::").concat(p,";\n").concat(T?"ALTER TABLE ".concat(s," ALTER COLUMN ").concat(l," SET DEFAULT ").concat(i(d),";\n"):h?"-- old default '".concat(d,"' was the removed value; set a new one:\n-- ALTER TABLE ").concat(s," ALTER COLUMN ").concat(l," SET DEFAULT ").concat(i(u||m[0]),";\n"):"","\n-- 4. Retire the old type and take over its name\nDROP TYPE ").concat(c,";\nALTER TYPE ").concat(p," RENAME TO ").concat(r(o),";\n\nCOMMIT;\n\n").concat(E),b="-- Re-create the original type and swap back:\nBEGIN;\nCREATE TYPE ".concat(p," AS ENUM (\n").concat(t.map(e=>" ".concat(i(e))).join(",\n"),"\n);\nALTER TABLE ").concat(s," ALTER COLUMN ").concat(l," DROP DEFAULT;\nALTER TABLE ").concat(s,"\n ALTER COLUMN ").concat(l," TYPE ").concat(p,"\n USING ").concat(l,"::text::").concat(p,";\n").concat(h?"ALTER TABLE ".concat(s," ALTER COLUMN ").concat(l," SET DEFAULT ").concat(i(d),";\n"):"","DROP TYPE ").concat(c,";\nALTER TYPE ").concat(p," RENAME TO ").concat(r(o),";\nCOMMIT;"),L.push("PostgreSQL has no DROP VALUE, so the only safe way to remove a label is to build a new type and cast the column across. Every other table, view, function or composite type using the enum must be altered in the same transaction, otherwise DROP TYPE fails with 'cannot drop type because other objects depend on it'."),L.push("Indexes on the column are rebuilt automatically by ALTER COLUMN TYPE. Expect the statement to take time proportional to the table size on large tables; run it in a maintenance window or set lock_timeout."),L.push("Never delete rows from pg_enum by hand: it leaves stored values pointing at a label that no longer exists and corrupts the column.");break}case"to_check":{let e=r("".concat(T.trim()||"my_table","_").concat(x.trim()||"status","_check"));A="BEGIN;\n\nALTER TABLE ".concat(s," ALTER COLUMN ").concat(l," DROP DEFAULT;\nALTER TABLE ").concat(s,"\n ALTER COLUMN ").concat(l," TYPE text\n USING ").concat(l,"::text;\n").concat(h?"ALTER TABLE ".concat(s," ALTER COLUMN ").concat(l," SET DEFAULT ").concat(i(d),";\n"):"","\nALTER TABLE ").concat(s,"\n ADD CONSTRAINT ").concat(e,"\n CHECK (").concat(l," IN (").concat(t.map(i).join(", "),"));\n\nDROP TYPE ").concat(c,";\n\nCOMMIT;\n\n-- Adding a value later is a constraint swap, no type change:\n-- ALTER TABLE ").concat(s," DROP CONSTRAINT ").concat(e,";\n-- ALTER TABLE ").concat(s," ADD CONSTRAINT ").concat(e,"\n-- CHECK (").concat(l," IN (").concat([...t,"new_value"].map(i).join(", "),"));"),b="BEGIN;\nCREATE TYPE ".concat(c," AS ENUM (\n").concat(t.map(e=>" ".concat(i(e))).join(",\n"),"\n);\nALTER TABLE ").concat(s," DROP CONSTRAINT ").concat(e,";\nALTER TABLE ").concat(s," ALTER COLUMN ").concat(l," DROP DEFAULT;\nALTER TABLE ").concat(s,"\n ALTER COLUMN ").concat(l," TYPE ").concat(c,"\n USING ").concat(l,"::").concat(c,";\n").concat(h?"ALTER TABLE ".concat(s," ALTER COLUMN ").concat(l," SET DEFAULT ").concat(i(d),";\n"):"","COMMIT;"),L.push("A text column with a CHECK constraint stores the label bytes (typically 5 to 10 bytes plus header) instead of a 4-byte OID and s
1orts alphabetically, not in declaration order. Add ORDER BY CASE ... if you relied on enum ordering."),L.push("Adding a value becomes DROP CONSTRAINT + ADD CONSTRAINT, which scans the table once to validate; use ADD CONSTRAINT ... NOT VALID followed by VALIDATE CONSTRAINT to avoid a long lock on large tables.");break}case"to_lookup":{let e=n.trim()?"".concat(r(n),".").concat(r(o+"_values")):r(o+"_values"),a=r("".concat(T.trim()||"my_table","_").concat(x.trim()||"status","_fkey"));A="BEGIN;\n\nCREATE TABLE ".concat(e," (\n code text PRIMARY KEY,\n label text NOT NULL,\n sort_order int NOT NULL\n);\n\nINSERT INTO ").concat(e," (code, label, sort_order) VALUES\n").concat(t.map((e,t)=>" (".concat(i(e),", ").concat(i(e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g," ")),", ").concat((t+1)*10,")")).join(",\n"),";\n\nALTER TABLE ").concat(s," ALTER COLUMN ").concat(l," DROP DEFAULT;\nALTER TABLE ").concat(s,"\n ALTER COLUMN ").concat(l," TYPE text\n USING ").concat(l,"::text;\n").concat(h?"ALTER TABLE ".concat(s," ALTER COLUMN ").concat(l," SET DEFAULT ").concat(i(d),";\n"):"","\nALTER TABLE ").concat(s,"\n ADD CONSTRAINT ").concat(a,"\n FOREIGN KEY (").concat(l,") REFERENCES ").concat(e," (code);\n\nDROP TYPE ").concat(c,";\n\nCOMMIT;\n\n-- Adding a value later is a plain INSERT, no DDL:\n-- INSERT INTO ").concat(e," VALUES ('new_value', 'New value', ").concat((t.length+1)*10,");\n\n-- Preserve the old enum ordering in queries:\n-- SELECT t.* FROM ").concat(s," t JOIN ").concat(e," v ON v.code = t.").concat(l," ORDER BY v.sort_order;"),b="BEGIN;\nCREATE TYPE ".concat(c," AS ENUM (\n").concat(t.map(e=>" ".concat(i(e))).join(",\n"),"\n);\nALTER TABLE ").concat(s," DROP CONSTRAINT ").concat(a,";\nALTER TABLE ").concat(s," ALTER COLUMN ").concat(l," DROP DEFAULT;\nALTER TABLE ").concat(s,"\n ALTER COLUMN ").concat(l," TYPE ").concat(c,"\n USING ").concat(l,"::").concat(c,";\n").concat(h?"ALTER TABLE ".concat(s," ALTER COLUMN ").concat(l," SET DEFAULT ").concat(i(d),";\n"):"","DROP TABLE ").concat(e,";\nCOMMIT;"),L.push("A lookup table lets you add, retire and relabel values with DML instead of DDL, attach metadata (display label, sort order, active flag) and reference the list from several tables. The cost is a join whenever you need the label, and the foreign-key check on writes."),L.push("Keep the code column short and stable (it is what rows store); put anything that may change in the label column.")}}return a.length?{sql:"",rollback:"",notes:a.join("\n")}:{sql:A,rollback:b,notes:L.map((e,t)=>"".concat(t+1,". ").concat(e)).join("\n\n")}},[e,n,m,p,T,x,g,N,w,y,O,D,U,k,I,_]),V="flex items-center gap-2 text-sm text-[#B8AFCA]";return(0,a.jsx)(c.ZP,{slug:"postgres-enum-type-generator",title:"Postgres Enum Generator: CREATE Type, ADD VALUE",description:"Generate PostgreSQL enum SQL: CREATE TYPE AS ENUM, ALTER TYPE ADD VALUE, RENAME VALUE, safe value removal, or migration to a CHECK constraint or lookup table.",h1:"Postgres Enum Type Generator",intro:"PostgreSQL enums are easy to create and surprisingly awkward to change: there is no DROP VALUE, ADD VALUE has transaction rules that break migration tools, and every dependent column must be cast when you rebuild the type. This generator writes the correct SQL for each situation. Enter the type name and its values, choose an operation, and get the forward migration, the rollback statements and the notes that matter, such as which steps rewrite the table or must run outside a transaction. Runs entirely in your browser.",howTo:["Enter the schema, enum type name and the current values, one per line in their sort order, plus the table and column that use the type.","Pick an operation: create the type and column, add or rename a value, remove a value safely, or convert the enum to a CHECK constraint or lookup table.","Copy the generated SQL into your migration file, keep the rollback block for the down migration, and read the notes before running it in production."],faq:[{q:"How do I add a value to an existing Postgres enum?",a:"Run ALTER TYPE type_name ADD VALUE 'new_value', optionally with IF NOT EXISTS and BEFORE or AFTER an existing label to control the sort position. Since PostgreSQL 12 this can run inside a transaction, but the new label cannot be used by any statement in that same transaction, which fails with 'unsafe use of new value'. Migration tools such as Flyway, Prisma, Django and Alembic wrap each migration in a transaction, so put the ADD VALUE in its own migration and reference the value in a later one. On PostgreSQL 11 and earlier the statement cannot run in a transaction block at all."},{q:"How do I remove a value from a Postgres enum?",a:"There is no ALTER TYPE ... DROP VALUE. The safe recipe, which the generator writes for you, is: update rows that still use the value, create a new enum type without it, alter the column to the new type with USING column::text::new_type, drop the old type and rename the new one to the original name. Do everything in a single transaction so a failure leaves nothing half-changed, and remember that ALTER COLUMN TYPE rewrites the table and rebuilds its indexes under an ACCESS EXCLUSIVE lock. Deleting rows from pg_enum by hand is not a shortcut: stored values would point at labels that no longer exist."},{q:"Should I use an enum, a CHECK constraint or a lookup table?",a:"Use an enum when the set of values is small, stable and needs a defined sort order; it stores 4 bytes per row and validates on write. Use text with a CHECK constraint when values change occasionally and you want plain DDL that every ORM understands, at the cost of alph
1abetical rather than declared ordering. Use a lookup table with a foreign key when values change often, need metadata such as display labels or an active flag, or are shared by several tables, because adding a value becomes a simple INSERT. The generator can convert an existing enum column to either alternative. Chat2DB shows enum types, constraints and foreign keys side by side in its schema browser and can run these migrations for you: download it at https://chat2db.ai/download or use the web version at https://app.chat2db.ai."}],children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,a.jsx)(c.PU,{label:"Operation",value:e,onChange:t,options:s}),(0,a.jsx)(d,{label:"Schema",value:n,onChange:h,width:"w-28"}),(0,a.jsx)(d,{label:"Type name",value:m,onChange:E}),(0,a.jsx)(d,{label:"Table",value:T,onChange:b}),(0,a.jsx)(d,{label:"Column",value:x,onChange:L,width:"w-32"}),(0,a.jsx)(d,{label:"Default",value:g,onChange:v,width:"w-32"}),"create"===e&&(0,a.jsxs)("label",{className:V,children:[(0,a.jsx)("input",{type:"checkbox",checked:N,onChange:e=>R(e.target.checked)}),"NOT NULL"]})]}),"add"===e&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,a.jsx)(d,{label:"New value",value:w,onChange:f}),(0,a.jsx)(c.PU,{label:"Position",value:y,onChange:C,options:l}),"end"!==y&&(0,a.jsx)(d,{label:"Relative to",value:O,onChange:S}),(0,a.jsxs)("label",{className:V,children:[(0,a.jsx)("input",{type:"checkbox",checked:D,onChange:e=>j(e.target.checked)}),"IF NOT EXISTS"]})]}),"rename"===e&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,a.jsx)(d,{label:"Old label",value:U,onChange:P}),(0,a.jsx)(d,{label:"New label",value:k,onChange:M})]}),"remove"===e&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,a.jsx)(d,{label:"Value to remove",value:I,onChange:B}),(0,a.jsx)(d,{label:"Replace rows with",value:_,onChange:F})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,a.jsx)(c.A1,{label:"Current enum values (one per line, in sort order)",value:p,onChange:A,rows:8}),(0,a.jsx)(c.A1,{label:"Generated SQL",value:Y.sql,readOnly:!0,rows:18})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,a.jsx)(c.A1,{label:"Rollback (down migration)",value:Y.rollback,readOnly:!0,rows:10}),(0,a.jsx)(c.A1,{label:"Notes and warnings",value:Y.notes,readOnly:!0,rows:10})]})]})})}}},function(e){e.O(0,[9257,9045,5812,7799,2888,9774,179],function(){return e(e.s=9570)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.