liquibase defaultvalue sys_guid

时间:2017-06-29 16:15:12

标签: oracle uuid liquibase default-value

如何使用liquibase将列默认为SYS_GUID()?我试过了

                                {
                                "column": {
                                    "name": "ID",
                                    "type": "varchar(32)",
                                    "constraints": {
                                        "nullable": false,
                                        "primariKey": true,
                                        "unique": true,
                                        "defaultValueComputed": "SYS_GUID()"
                                    }
                                }
                            },

还尝试将sys guid更改为uuid

                                    "column": {
                                    "name": "ID",
                                    "type": "varchar(32)"                                        
                                    "constraints": {
                                        "nullable": false,
                                        "primariKey": true,
                                        "unique": true,
                                        "defaultValueComputed": "UUID"
                                    }
                                }

1 个答案:

答案 0 :(得分:2)

抱歉这个愚蠢的问题,就像这样:

                                    "column": {
                                    "name": "ID",
                                    "type": "varchar(32)",
                                    "defaultValueComputed": "SYS_GUID()",
                                    "constraints": {
                                        "nullable": false,
                                        "primariKey": true,
                                        "unique": true
                                    }
                                }

我笨到足以将默认值放在约束