---main tweet table
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TweetBank](
    [tweet_id] [BIGINT] NOT NULL,
    [tweet_datetime] [datetime] NULL,
    [tweet_keyword] [VARCHAR](50) NULL,
    [tweet] [VARCHAR](200) NULL,
    [tweeter] [VARCHAR](MAX) NULL,
    [lang] [VARCHAR](50) NULL,
    [geo] [VARCHAR](50) NULL,
 CONSTRAINT [PK_TweetBank] PRIMARY KEY CLUSTERED
(
    [tweet_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
        IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
        ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO



--temp tweet table (see below)
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TweetBankTemp](
    [tweet_id] [BIGINT] NOT NULL,
    [tweet_datetime] [datetime] NULL,
    [tweet_keyword] [VARCHAR](50) NULL,
    [tweet] [VARCHAR](200) NULL,
    [tweeter] [VARCHAR](MAX) NULL,
    [lang] [VARCHAR](50) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO



--a tweet run logging table (for fun)
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TweetLog](
    [RunId] [INT] IDENTITY(1,1) NOT NULL,
    [BatchId] [INT] NULL,
    [RunDate] [datetime] NULL,
    [Keyword] [VARCHAR](50) NULL,
    [HarvestedThisRun] [INT] NULL,
    [TotalHarvested] [INT] NULL,
 CONSTRAINT [PK_TweetLog] PRIMARY KEY CLUSTERED
(
    [RunId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
       IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
       ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO