{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Data Workbench","type":"markdown"},"seo":{"title":"Modifying the Table Schema","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"modifying-the-table-schema","__idx":0},"children":["Modifying the Table Schema"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are two ways to update a table ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/databases/schema-management"},"children":["Schema Management"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"using-treasure-console","__idx":1},"children":["Using Treasure Console"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To update schema manually, navigate to:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open Treasure Console."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Databases."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select a database for which you want to modify the schema."," ","For example, test_db or:"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200827-003304.3bfad70b9a5d739de38252750160786a4865d5d93105e48c9f17c369c3e8a51b.4c190181.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select a table."," ","For example:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200827-004729.2046a096a96af4ded16a15ee90994eec1585f3bdde5e021ea351792ec6af1965.4c190181.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add Column"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200827-004821.c1caa0943e4d8f021ecc7231c679d762a879a26cdc87f5f1ffec3230fb3f3ed4.4c190181.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Specify the table metadata details."," ","For example:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200827-010304.b851e4ff0c83e13372fe38d4a611479966c15456ce47ed960375a64262029044.4c190181.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":7},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, to continue customizing the schema and metadata, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Edit Schema"]},"."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200827-010428.c9cf9d76c91134fb2ca71d84d3ea0e2af4ab18a441fb6c1aaa40a9818e4f6541.4c190181.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":9},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, to continue customizing the schema and metadata, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add Column."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, to delete a column from your table, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Edit Schema"]}," and select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["x"]}," to the far right of the page."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["… > Table Settings"]},"."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200827-011034.eb96d55c9fc2ebdd96a8285fed23a404223bfd458b1dc5b24316a10002ca8be5.4c190181.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":12},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, make selections on ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Edit Settings"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Confirm"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]}," when your schema modification is complete."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"using-treasure-cli-tool","__idx":2},"children":["Using Treasure CLI Tool"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Alternatively, you can use the td schema:set command"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["where ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<column_name>"]}," consists of lowercase alphabets, numbers, and \"_\" only"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["where ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<type>"]}," can be one of the following: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["int"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["long"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["double"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["float"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array<T>"]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td schema:set <database> <table> <column_name>:<type>...\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For this example, the schema would be added as follows:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td schema:set testdb www_access action:string labels:'array<string>' user:int\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can find available data types on ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/databases/td-native-data-types"},"children":["TD Native Data Types"]},"."]}]},"headings":[{"value":"Modifying the Table Schema","id":"modifying-the-table-schema","depth":1},{"value":"Using Treasure Console","id":"using-treasure-console","depth":2},{"value":"Using Treasure CLI Tool","id":"using-treasure-cli-tool","depth":2}],"frontmatter":{"seo":{"title":"Modifying the Table Schema"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/data-workbench/databases/modifying-the-table-schema","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}