[{"data":1,"prerenderedAt":580},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fstreams\u002Fdatabase-structure-options":3},{"id":4,"title":5,"body":6,"description":571,"extension":572,"meta":573,"navigation":574,"path":575,"redirect":576,"seo":577,"stem":578,"__hash__":579},"docs\u002Fdocs\u002Fstreams\u002Fdatabase-structure-options.md","Database Structure Options",{"type":7,"value":8,"toc":561},"minimark",[9,13,22,25,38,46,51,61,68,82,85,89,181,187,191,264,268,310,314,320,340,344,347,506,510,513,527,531,557],[10,11,5],"h1",{"id":12},"database-structure-options",[14,15,16,17,21],"p",{},"Structure options control which parts of the target table definition DBConvert Streams creates when ",[18,19,20],"strong",{},"Create structure"," is enabled.",[14,23,24],{},"Use this page when:",[26,27,28,32,35],"ul",{},[29,30,31],"li",{},"you want DBConvert Streams to create target tables for you",[29,33,34],{},"you want to skip indexes, foreign keys, or check constraints during the initial run",[29,36,37],{},"you need to understand what the advanced toggles in the wizard actually do",[14,39,40,41,45],{},"In the API, these settings live in ",[42,43,44],"code",{},"target.spec.db.structureOptions",".",[47,48,50],"h2",{"id":49},"how-the-ui-works","How the UI works",[14,52,53,54,57,58,60],{},"In the stream wizard, the ",[18,55,56],{},"Structure & Data"," step has a master ",[18,59,20],{}," checkbox.",[14,62,63,64,67],{},"When that checkbox is enabled, you can open ",[18,65,66],{},"Advanced options"," and choose:",[26,69,70,73,76,79],{},[29,71,72],{},"Tables",[29,74,75],{},"Indexes",[29,77,78],{},"Foreign keys",[29,80,81],{},"Check constraints",[14,83,84],{},"These toggles refine structure creation. They do not currently backfill indexes, foreign keys, or check constraints onto existing tables by themselves when table creation is off.",[47,86,88],{"id":87},"options","Options",[90,91,92,111],"table",{},[93,94,95],"thead",{},[96,97,98,102,105,108],"tr",{},[99,100,101],"th",{},"Label in UI",[99,103,104],{},"API field",[99,106,107],{},"What it affects during table creation",[99,109,110],{},"Ignored when",[112,113,114,132,149,165],"tbody",{},[96,115,116,119,124,127],{},[117,118,72],"td",{},[117,120,121],{},[42,122,123],{},"tables",[117,125,126],{},"Creates target tables when they do not exist.",[117,128,129,131],{},[18,130,20],{}," is off.",[96,133,134,136,141,144],{},[117,135,75],{},[117,137,138],{},[42,139,140],{},"indexes",[117,142,143],{},"Creates primary keys, unique indexes, and secondary indexes as part of table materialization.",[117,145,146,148],{},[18,147,20],{}," is off, or table creation is off.",[96,150,151,153,158,161],{},[117,152,78],{},[117,154,155],{},[42,156,157],{},"foreignKeys",[117,159,160],{},"Adds foreign key constraints after tables are created.",[117,162,163,148],{},[18,164,20],{},[96,166,167,169,174,177],{},[117,168,81],{},[117,170,171],{},[42,172,173],{},"checkConstraints",[117,175,176],{},"Includes check constraints in generated table DDL.",[117,178,179,148],{},[18,180,20],{},[14,182,183,184,45],{},"All four options default to ",[42,185,186],{},"true",[47,188,190],{"id":189},"common-setups","Common setups",[90,192,193,208],{},[93,194,195],{},[96,196,197,200,202,204,206],{},[99,198,199],{},"Goal",[99,201,72],{},[99,203,75],{},[99,205,78],{},[99,207,81],{},[112,209,210,224,238,251],{},[96,211,212,215,218,220,222],{},[117,213,214],{},"Strict schema copy",[117,216,217],{},"On",[117,219,217],{},[117,221,217],{},[117,223,217],{},[96,225,226,229,231,234,236],{},[117,227,228],{},"Faster initial load",[117,230,217],{},[117,232,233],{},"Off",[117,235,233],{},[117,237,217],{},[96,239,240,243,245,247,249],{},[117,241,242],{},"DBA-managed existing schema",[117,244,233],{},[117,246,233],{},[117,248,233],{},[117,250,233],{},[96,252,253,256,258,260,262],{},[117,254,255],{},"Create missing tables but avoid relationship enforcement",[117,257,217],{},[117,259,217],{},[117,261,233],{},[117,263,217],{},[47,265,267],{"id":266},"when-to-disable-each-option","When to disable each option",[90,269,270,280],{},[93,271,272],{},[96,273,274,277],{},[99,275,276],{},"Option",[99,278,279],{},"Disable it when",[112,281,282,289,296,303],{},[96,283,284,286],{},[117,285,72],{},[117,287,288],{},"The target schema is managed outside the stream and DBConvert Streams should only write data.",[96,290,291,293],{},[117,292,75],{},[117,294,295],{},"You want to reduce write overhead during a large initial load and create indexes later.",[96,297,298,300],{},[117,299,78],{},[117,301,302],{},"You want to avoid insert-order issues or reduce enforcement overhead during loading.",[96,304,305,307],{},[117,306,81],{},[117,308,309],{},"The source constraints use engine-specific expressions that may not translate cleanly.",[47,311,313],{"id":312},"what-does-not-happen","What does not happen",[14,315,316,317,319],{},"If ",[18,318,72],{}," is off, the other toggles are not used as standalone “patch existing schema” actions for already-existing tables.",[14,321,322,323,328,329,332,333,336,337,45],{},"Use ",[324,325,327],"a",{"href":326},"\u002Fdocs\u002Fstreams\u002Ftarget-data-policies","Target Schema and Data Policies"," with this page: structure options decide ",[18,330,331],{},"what"," to create, schema policy decides ",[18,334,335],{},"whether"," creation is allowed, and write mode decides ",[18,338,339],{},"what to do with existing rows",[47,341,343],{"id":342},"api-example","API example",[14,345,346],{},"This example creates tables and check constraints, but skips indexes and foreign keys:",[348,349,354],"pre",{"className":350,"code":351,"language":352,"meta":353,"style":353},"language-json shiki shiki-themes github-light github-dark","{\n  \"target\": {\n    \"id\": \"conn_TARGET_ID\",\n    \"spec\": {\n      \"db\": {\n        \"database\": \"target_db\",\n        \"structureOptions\": {\n          \"tables\": true,\n          \"indexes\": false,\n          \"foreignKeys\": false,\n          \"checkConstraints\": true\n        }\n      }\n    }\n  }\n}\n","json","",[42,355,356,365,375,391,399,407,420,428,440,453,465,476,482,488,494,500],{"__ignoreMap":353},[357,358,361],"span",{"class":359,"line":360},"line",1,[357,362,364],{"class":363},"sVt8B","{\n",[357,366,368,372],{"class":359,"line":367},2,[357,369,371],{"class":370},"sj4cs","  \"target\"",[357,373,374],{"class":363},": {\n",[357,376,378,381,384,388],{"class":359,"line":377},3,[357,379,380],{"class":370},"    \"id\"",[357,382,383],{"class":363},": ",[357,385,387],{"class":386},"sZZnC","\"conn_TARGET_ID\"",[357,389,390],{"class":363},",\n",[357,392,394,397],{"class":359,"line":393},4,[357,395,396],{"class":370},"    \"spec\"",[357,398,374],{"class":363},[357,400,402,405],{"class":359,"line":401},5,[357,403,404],{"class":370},"      \"db\"",[357,406,374],{"class":363},[357,408,410,413,415,418],{"class":359,"line":409},6,[357,411,412],{"class":370},"        \"database\"",[357,414,383],{"class":363},[357,416,417],{"class":386},"\"target_db\"",[357,419,390],{"class":363},[357,421,423,426],{"class":359,"line":422},7,[357,424,425],{"class":370},"        \"structureOptions\"",[357,427,374],{"class":363},[357,429,431,434,436,438],{"class":359,"line":430},8,[357,432,433],{"class":370},"          \"tables\"",[357,435,383],{"class":363},[357,437,186],{"class":370},[357,439,390],{"class":363},[357,441,443,446,448,451],{"class":359,"line":442},9,[357,444,445],{"class":370},"          \"indexes\"",[357,447,383],{"class":363},[357,449,450],{"class":370},"false",[357,452,390],{"class":363},[357,454,456,459,461,463],{"class":359,"line":455},10,[357,457,458],{"class":370},"          \"foreignKeys\"",[357,460,383],{"class":363},[357,462,450],{"class":370},[357,464,390],{"class":363},[357,466,468,471,473],{"class":359,"line":467},11,[357,469,470],{"class":370},"          \"checkConstraints\"",[357,472,383],{"class":363},[357,474,475],{"class":370},"true\n",[357,477,479],{"class":359,"line":478},12,[357,480,481],{"class":363},"        }\n",[357,483,485],{"class":359,"line":484},13,[357,486,487],{"class":363},"      }\n",[357,489,491],{"class":359,"line":490},14,[357,492,493],{"class":363},"    }\n",[357,495,497],{"class":359,"line":496},15,[357,498,499],{"class":363},"  }\n",[357,501,503],{"class":359,"line":502},16,[357,504,505],{"class":363},"}\n",[47,507,509],{"id":508},"verification","Verification",[14,511,512],{},"After you start the stream:",[26,514,515,518,521],{},[29,516,517],{},"confirm the stream reaches structure creation instead of stopping on schema policy validation",[29,519,520],{},"if indexes or foreign keys are disabled, verify that the target tables exist without those extra objects",[29,522,523,524,526],{},"if ",[18,525,72],{}," is off, do not expect DBConvert Streams to backfill missing indexes or constraints onto existing tables",[47,528,530],{"id":529},"related-docs","Related docs",[26,532,533,538,544,550],{},[29,534,535,537],{},[324,536,327],{"href":326}," — schema policy and write mode",[29,539,540],{},[324,541,543],{"href":542},"\u002Fdocs\u002Fstreams\u002Fstream-configuration-guide","Stream Configuration Guide",[29,545,546],{},[324,547,549],{"href":548},"\u002Fdocs\u002Fstreams\u002Fstream-config-reference","Stream Configuration Reference",[29,551,552,556],{},[324,553,555],{"href":554},"\u002Fdocs\u002Fintegration\u002Ftranslate-ddl","Table Structure Conversion"," — data type mapping between MySQL and PostgreSQL",[558,559,560],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":353,"searchDepth":367,"depth":367,"links":562},[563,564,565,566,567,568,569,570],{"id":49,"depth":367,"text":50},{"id":87,"depth":367,"text":88},{"id":189,"depth":367,"text":190},{"id":266,"depth":367,"text":267},{"id":312,"depth":367,"text":313},{"id":342,"depth":367,"text":343},{"id":508,"depth":367,"text":509},{"id":529,"depth":367,"text":530},"Control which parts of the target table definition DBConvert Streams creates during stream execution.","md",{},false,"\u002Fdocs\u002Fstreams\u002Fdatabase-structure-options",null,{"title":5,"description":571},"docs\u002Fstreams\u002Fdatabase-structure-options","NE6dzxtjm9vEKOIW3O171MVcIx5gG7XP9XZt7GfnVOs",1783896284847]