File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change 1
- # encoding: utf-8
2
-
3
1
import datetime
4
2
import uuid
5
3
import logging
6
-
7
4
import sqlalchemy as sa
8
-
9
- from sqlalchemy import Column , Unicode , DateTime
10
- from sqlalchemy .ext .declarative import declarative_base
11
5
from sqlalchemy .dialects .postgresql import JSON
12
-
13
- from ckan .model .meta import metadata
14
-
15
6
from ckan import model
7
+ from ckantoolkit import config
16
8
from ckan .model .meta import mapper , metadata
17
9
18
10
log = logging .getLogger (__name__ )
@@ -22,8 +14,6 @@ def make_uuid():
22
14
return str (uuid .uuid4 ())
23
15
24
16
25
- Base = declarative_base (metadata = metadata )
26
-
27
17
class Validation (model .DomainObject ):
28
18
@classmethod
29
19
def get (cls , ** kw ):
@@ -52,6 +42,7 @@ def create_tables():
52
42
53
43
54
44
def tables_exist ():
55
-
56
-
57
- return False
45
+ eng = sa .create_engine (config .get ('sqlalchemy.url' ))
46
+ x = sa .inspect (eng ).has_table ("validation" )
47
+ return x
48
+
You can’t perform that action at this time.
0 commit comments