数据库篇之[bsp_banners]数据表-网上商城BrnShop1.9升级至2.1升级说明(非官方版本)

简介:

asp.net(c#)网上商城BrnShop1.9升级至2.1升级说明(非官方版本)
主要描述在数据库方面进行升级(使用前请参照网上商城BrnShop1.9升级至2.1升级说明(非官方版本仅提供技术交流)的使用协议)

BrnShop1.9正式版本

/****** Object:  Table [dbo].[bsp_banners]    Script Date: 12/09/2014 14:07:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [bsp_banners](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[starttime] [datetime] NOT NULL,
	[endtime] [datetime] NOT NULL,
	[isshow] [tinyint] NOT NULL,
	[title] [nvarchar](100) NOT NULL,
	[img] [nvarchar](250) NOT NULL,
	[url] [nvarchar](250) NOT NULL,
	[displayorder] [int] NOT NULL,
 CONSTRAINT [PK_bsp_banners] PRIMARY KEY CLUSTERED 
(
	[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]
GO
CREATE NONCLUSTERED INDEX [starttime_endtime_isshow] ON [bsp_banners] 
(
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'bannerid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'starttime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'endtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否展示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'isshow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'img'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'displayorder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'banner表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners'
GO
SET IDENTITY_INSERT [bsp_banners] ON
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (1, CAST(0x0000A35100B595F0 AS DateTime), CAST(0x0000A4D700B595F0 AS DateTime), 1, N'火爆促销', N'fr_1412061404492825858.jpg', N'/', 5)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (4, CAST(0x0000A385017AA854 AS DateTime), CAST(0x0000A4D6017AA854 AS DateTime), 1, N'火爆促销', N'fr_1412061404419541666.jpg', N'/', 6)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (5, CAST(0x0000A3EB0148AB74 AS DateTime), CAST(0x0000A5580148AB74 AS DateTime), 1, N'火爆促销', N'fr_1412061405306289506.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (6, CAST(0x0000A3EB0148CD70 AS DateTime), CAST(0x0000A5540148CD70 AS DateTime), 1, N'火爆促销', N'fr_1412061404554409380.jpg', N'/', 0)
SET IDENTITY_INSERT [bsp_banners] OFF


BrnShop2.1正式版本

/****** Object:  Table [dbo].[bsp_banners]    Script Date: 01/13/2015 10:11:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [bsp_banners](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[type] [tinyint] NOT NULL,
	[starttime] [datetime] NOT NULL,
	[endtime] [datetime] NOT NULL,
	[isshow] [tinyint] NOT NULL,
	[title] [nvarchar](100) NOT NULL,
	[img] [nvarchar](250) NOT NULL,
	[url] [nvarchar](250) NOT NULL,
	[displayorder] [int] NOT NULL,
 CONSTRAINT [PK_bsp_banners] PRIMARY KEY CLUSTERED 
(
	[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]
GO
CREATE NONCLUSTERED INDEX [type_starttime_endtime_isshow] ON [bsp_banners] 
(
	[type] ASC,
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'bannerid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型(0代表PC,1代表手机)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'starttime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'endtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否展示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'isshow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'img'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'displayorder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'banner表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners'
GO
SET IDENTITY_INSERT [bsp_banners] ON
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (1, 0, CAST(0x0000A35100B595F0 AS DateTime), CAST(0x0000A4D700B595F0 AS DateTime), 1, N'火爆促销', N'fr_1412061404492825858.jpg', N'/', 5)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (4, 0, CAST(0x0000A385017AA854 AS DateTime), CAST(0x0000A4D6017AA854 AS DateTime), 1, N'火爆促销', N'fr_1412061404419541666.jpg', N'/', 6)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (5, 0, CAST(0x0000A3EB0148AB74 AS DateTime), CAST(0x0000A5580148AB74 AS DateTime), 1, N'火爆促销', N'fr_1412061405306289506.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (6, 0, CAST(0x0000A3EB0148CD70 AS DateTime), CAST(0x0000A5540148CD70 AS DateTime), 1, N'火爆促销', N'fr_1412061404554409380.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (7, 1, CAST(0x0000A40700AEA434 AS DateTime), CAST(0x0000A6E400AEA434 AS DateTime), 1, N'特大促销', N'fr_1412201036420464063.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (8, 1, CAST(0x0000A40700AEEF34 AS DateTime), CAST(0x0000A6DD00AEEF34 AS DateTime), 1, N'特大促销', N'fr_1412201037096779867.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (9, 1, CAST(0x0000A40700AF0B54 AS DateTime), CAST(0x0000A6E400AF0B54 AS DateTime), 1, N'特大促销', N'fr_1412201037338523694.jpg', N'/', 0)
SET IDENTITY_INSERT [bsp_banners] OFF

其中差异内容如图

差异内容有:

1.有[type]列

2.非聚合索引名称

3.执行增加扩展属性

4.数据插入

更新方法:

ALTER TABLE [bsp_banners]
  ADD [type] [tinyint]
  GO
  UPDATE [bsp_banners]
  SET [type] = 0	-- 默认为PC端
  GO
  ALTER TABLE [bsp_banners]
  ALTER COLUMN [type] [tinyint] NOT NULL	-- 
  GO
  CREATE NONCLUSTERED INDEX [type_starttime_endtime_isshow] ON [bsp_banners] 
(
	[type] ASC,
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型(0代表PC,1代表手机)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'type'


目录
相关文章
|
2月前
|
缓存 数据库 数据安全/隐私保护
Discuz! X 数据库字典详解:DZ各数据表作用及字段含义
我们使用DISCUZ做网站时,有时需要对数据表进行操作,在操作数据表之前,需要对数据表进行了解。下面是DISCUZ 数据库各数据表作用及字段含义详解,方便新手更好的了解DISCUZ数据库。
70 4
|
2月前
|
SQL JSON 关系型数据库
MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
【10月更文挑战第3天】MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
179 5
|
1月前
|
SQL 关系型数据库 数据库连接
"Nacos 2.1.0版本数据库配置写入难题破解攻略:一步步教你排查连接、权限和配置问题,重启服务轻松解决!"
【10月更文挑战第23天】在使用Nacos 2.1.0版本时,可能会遇到无法将配置信息写入数据库的问题。本文将引导你逐步解决这一问题,包括检查数据库连接、用户权限、Nacos配置文件,并提供示例代码和详细步骤。通过这些方法,你可以有效解决配置写入失败的问题。
71 0
|
2月前
|
XML 缓存 数据库
Discuz! X3.0 版本的数据库字典
Discuz! X3.0 版本的数据库字典
59 0
|
2月前
|
JavaScript 前端开发 测试技术
[新手入门]todolist增删改查:vue3+ts版本!
【10月更文挑战第15天】[新手入门]todolist增删改查:vue3+ts版本!
|
2月前
|
监控 关系型数据库 MySQL
如何升级MySQL数据库?
【10月更文挑战第16天】如何升级MySQL数据库?
|
12天前
|
关系型数据库 MySQL 数据库
Python处理数据库:MySQL与SQLite详解 | python小知识
本文详细介绍了如何使用Python操作MySQL和SQLite数据库,包括安装必要的库、连接数据库、执行增删改查等基本操作,适合初学者快速上手。
82 15
|
6天前
|
SQL 关系型数据库 MySQL
数据库数据恢复—Mysql数据库表记录丢失的数据恢复方案
Mysql数据库故障: Mysql数据库表记录丢失。 Mysql数据库故障表现: 1、Mysql数据库表中无任何数据或只有部分数据。 2、客户端无法查询到完整的信息。
|
13天前
|
关系型数据库 MySQL 数据库
数据库数据恢复—MYSQL数据库文件损坏的数据恢复案例
mysql数据库文件ibdata1、MYI、MYD损坏。 故障表现:1、数据库无法进行查询等操作;2、使用mysqlcheck和myisamchk无法修复数据库。
|
17天前
|
SQL 关系型数据库 MySQL
MySQL导入.sql文件后数据库乱码问题
本文分析了导入.sql文件后数据库备注出现乱码的原因,包括字符集不匹配、备注内容编码问题及MySQL版本或配置问题,并提供了详细的解决步骤,如检查和统一字符集设置、修改客户端连接方式、检查MySQL配置等,确保导入过程顺利。
下一篇
DataWorks